home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.89.06.sit / SC.016.OffSample / OffSample.p < prev    next >
MacBinary  |  1989-04-01  |  45.3 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sat Apr 1 15:03:02 1989, modified Sat Apr 1 15:03:02 1989, creator 'MPS ', type ASCII, 45048 bytes "OffSample.p" , at 0xb078 1088 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 4f 66 66 53 61 6d | 70 6c 65 2e 70 00 00 00 |..OffSam|ple.p...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 af f8 00 | 00 04 40 a0 5a db 76 a0 |........|..@.Z.v.|
|00000060| 5a db 76 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Z.v.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c3 1b 00 00 |........|........|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4f 66 66 73 | 63 72 65 65 6e 20 42 75 |#.#.Offs|creen Bu|
|00000110| 66 66 65 72 20 53 61 6d | 70 6c 65 20 41 70 70 6c |ffer Sam|ple Appl|
|00000120| 69 63 61 74 69 6f 6e 0d | 23 0d 23 09 4f 66 66 53 |ication.|#.#.OffS|
|00000130| 61 6d 70 6c 65 0d 23 0d | 23 09 4f 66 66 53 61 6d |ample.#.|#.OffSam|
|00000140| 70 6c 65 2e 70 09 09 2d | 09 50 61 73 63 61 6c 20 |ple.p..-|.Pascal |
|00000150| 53 6f 75 72 63 65 0d 23 | 0d 23 09 43 6f 70 79 72 |Source.#|.#.Copyr|
|00000160| 69 67 68 74 20 a9 20 31 | 39 38 39 20 41 70 70 6c |ight . 1|989 Appl|
|00000170| 65 20 43 6f 6d 70 75 74 | 65 72 2c 20 49 6e 63 2e |e Comput|er, Inc.|
|00000180| 0d 23 09 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 |.#.All r|ights re|
|00000190| 73 65 72 76 65 64 2e 0d | 23 0d 23 09 56 65 72 73 |served..|#.#.Vers|
|000001a0| 69 6f 6e 73 3a 09 0d 23 | 09 09 09 09 31 2e 30 30 |ions:..#|....1.00|
|000001b0| 09 09 09 09 30 33 2f 38 | 39 0d 23 0d 23 09 43 6f |....03/8|9.#.#.Co|
|000001c0| 6d 70 6f 6e 65 6e 74 73 | 3a 0d 23 09 09 09 09 4f |mponents|:.#....O|
|000001d0| 66 66 53 61 6d 70 6c 65 | 2e 70 09 09 09 41 70 72 |ffSample|.p...Apr|
|000001e0| 69 6c 20 31 2c 20 31 39 | 38 39 0d 23 09 09 09 09 |il 1, 19|89.#....|
|000001f0| 4f 66 66 53 61 6d 70 6c | 65 2e 72 09 09 09 41 70 |OffSampl|e.r...Ap|
|00000200| 72 69 6c 20 31 2c 20 31 | 39 38 39 0d 23 09 09 09 |ril 1, 1|989.#...|
|00000210| 09 4f 66 66 53 61 6d 70 | 6c 65 2e 68 09 09 09 41 |.OffSamp|le.h...A|
|00000220| 70 72 69 6c 20 31 2c 20 | 31 39 38 39 0d 23 09 09 |pril 1, |1989.#..|
|00000230| 09 09 50 4f 66 66 53 61 | 6d 70 6c 65 2e 6d 61 6b |..POffSa|mple.mak|
|00000240| 65 09 09 41 70 72 69 6c | 20 31 2c 20 31 39 38 39 |e..April| 1, 1989|
|00000250| 0d 23 0d 23 09 52 65 71 | 75 69 72 65 6d 65 6e 74 |.#.#.Req|uirement|
|00000260| 73 3a 0d 23 09 09 09 09 | 4f 66 66 73 63 72 65 65 |s:.#....|Offscree|
|00000270| 6e 2e 70 09 09 09 41 70 | 72 69 6c 20 31 2c 20 31 |n.p...Ap|ril 1, 1|
|00000280| 39 38 39 0d 23 09 09 09 | 09 4f 66 66 73 63 72 65 |989.#...|.Offscre|
|00000290| 65 6e 2e 69 6e 63 31 2e | 70 09 41 70 72 69 6c 20 |en.inc1.|p.April |
|000002a0| 31 2c 20 31 39 38 39 0d | 23 09 09 09 09 55 46 61 |1, 1989.|#....UFa|
|000002b0| 69 6c 75 72 65 2e 70 09 | 09 09 4e 6f 76 65 6d 62 |ilure.p.|..Novemb|
|000002c0| 65 72 20 31 2c 20 31 39 | 38 38 0d 23 09 09 09 09 |er 1, 19|88.#....|
|000002d0| 55 46 61 69 6c 75 72 65 | 2e 69 6e 63 31 2e 70 09 |UFailure|.inc1.p.|
|000002e0| 09 4e 6f 76 65 6d 62 65 | 72 20 31 2c 20 31 39 38 |.Novembe|r 1, 198|
|000002f0| 38 0d 23 09 09 09 09 55 | 46 61 69 6c 75 72 65 2e |8.#....U|Failure.|
|00000300| 61 09 09 09 4e 6f 76 65 | 6d 62 65 72 20 31 2c 20 |a...Nove|mber 1, |
|00000310| 31 39 38 38 0d 23 0d 23 | 09 4f 66 66 53 61 6d 70 |1988.#.#|.OffSamp|
|00000320| 6c 65 20 64 65 6d 6f 6e | 73 74 72 61 74 65 73 20 |le demon|strates |
|00000330| 74 68 65 20 75 73 61 67 | 65 20 6f 66 20 74 68 65 |the usag|e of the|
|00000340| 20 4f 66 66 73 63 72 65 | 65 6e 0d 23 09 75 6e 69 | Offscre|en.#.uni|
|00000350| 74 2e 20 49 74 20 73 68 | 6f 77 73 20 68 6f 77 20 |t. It sh|ows how |
|00000360| 74 6f 20 75 73 65 20 6f | 66 66 73 63 72 65 65 6e |to use o|ffscreen|
|00000370| 20 70 69 78 6d 61 70 73 | 20 61 6e 64 0d 23 09 62 | pixmaps| and.#.b|
|00000380| 69 74 6d 61 70 73 20 74 | 6f 20 70 72 6f 64 75 63 |itmaps t|o produc|
|00000390| 65 20 66 6c 69 63 6b 65 | 72 2d 66 72 65 65 20 75 |e flicke|r-free u|
|000003a0| 70 64 61 74 69 6e 67 20 | 77 69 74 68 20 61 0d 23 |pdating |with a.#|
|000003b0| 09 6d 69 6e 69 6d 75 6d | 20 6f 66 20 72 65 2d 73 |.minimum| of re-s|
|000003c0| 74 72 75 63 74 75 72 69 | 6e 67 20 6f 66 20 63 6f |tructuri|ng of co|
|000003d0| 64 65 2e 20 4f 66 66 53 | 61 6d 70 6c 65 20 61 74 |de. OffS|ample at|
|000003e0| 74 65 6d 70 74 73 0d 23 | 09 74 6f 20 72 65 64 75 |tempts.#|.to redu|
|000003f0| 63 65 20 74 68 65 20 61 | 6d 6f 75 6e 74 20 6f 66 |ce the a|mount of|
|00000400| 20 27 6b 6e 6f 77 6c 65 | 64 67 65 27 20 74 68 61 | 'knowle|dge' tha|
|00000410| 74 20 69 74 20 68 61 73 | 20 6f 66 0d 23 09 74 68 |t it has| of.#.th|
|00000420| 65 20 6f 66 66 73 63 72 | 65 65 6e 20 73 74 72 75 |e offscr|een stru|
|00000430| 63 74 75 72 65 20 73 6f | 20 61 73 20 74 6f 20 6d |cture so| as to m|
|00000440| 69 6e 69 6d 69 7a 65 20 | 69 74 73 0d 23 09 64 65 |inimize |its.#.de|
|00000450| 70 65 6e 64 65 6e 63 65 | 20 6f 6e 20 74 68 61 74 |pendence| on that|
|00000460| 20 75 6e 69 74 2e 0d 23 | 0d 23 09 4f 66 66 53 61 | unit..#|.#.OffSa|
|00000470| 6d 70 6c 65 20 65 6d 70 | 68 61 73 69 7a 65 73 20 |mple emp|hasizes |
|00000480| 75 73 69 6e 67 20 74 68 | 65 20 4f 66 66 73 63 72 |using th|e Offscr|
|00000490| 65 65 6e 20 75 6e 69 74 | 3b 20 69 74 0d 23 09 69 |een unit|; it.#.i|
|000004a0| 73 20 6e 6f 74 20 69 6e | 74 65 6e 64 65 64 20 74 |s not in|tended t|
|000004b0| 6f 20 62 65 20 76 69 65 | 77 65 64 20 61 73 20 61 |o be vie|wed as a|
|000004c0| 20 63 6f 6d 70 6c 65 74 | 65 20 61 70 70 6c 69 63 | complet|e applic|
|000004d0| 61 74 69 6f 6e 0d 23 09 | 66 72 6f 6d 20 77 68 69 |ation.#.|from whi|
|000004e0| 63 68 20 74 6f 20 62 61 | 73 65 20 73 6f 6d 65 20 |ch to ba|se some |
|000004f0| 6c 61 72 67 65 72 20 65 | 66 66 6f 72 74 2e 20 49 |larger e|ffort. I|
|00000500| 6e 73 74 65 61 64 2c 20 | 69 74 73 0d 23 09 6d 65 |nstead, |its.#.me|
|00000510| 74 68 6f 64 20 6f 66 20 | 75 73 69 6e 67 20 6f 66 |thod of |using of|
|00000520| 66 73 63 72 65 65 6e 20 | 62 69 74 6d 61 70 73 20 |fscreen |bitmaps |
|00000530| 61 6e 64 20 70 69 78 6d | 61 70 73 20 73 68 6f 75 |and pixm|aps shou|
|00000540| 6c 64 0d 23 09 62 65 20 | 73 74 75 64 69 65 64 20 |ld.#.be |studied |
|00000550| 61 6e 64 20 61 64 61 70 | 74 65 64 20 74 6f 20 6f |and adap|ted to o|
|00000560| 74 68 65 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ther app|lication|
|00000570| 73 20 74 68 61 74 0d 23 | 09 64 65 73 69 72 65 20 |s that.#|.desire |
|00000580| 66 65 61 74 75 72 65 73 | 20 73 75 63 68 20 61 73 |features| such as|
|00000590| 20 66 6c 69 63 6b 65 72 | 2d 66 72 65 65 20 75 70 | flicker|-free up|
|000005a0| 64 61 74 69 6e 67 2e 0d | 23 0d 2d 2d 2d 2d 2d 2d |dating..|#.------|
|000005b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005f0| 2d 2d 2d 2d 2d 2d 2d 2d | 7d 0d 0d 0d 50 52 4f 47 |--------|}...PROG|
|00000600| 52 41 4d 20 4f 66 66 53 | 61 6d 70 6c 65 3b 0d 0d |RAM OffS|ample;..|
|00000610| 55 53 45 53 0d 09 4d 65 | 6d 54 79 70 65 73 2c 20 |USES..Me|mTypes, |
|00000620| 51 75 69 63 6b 44 72 61 | 77 2c 20 50 61 6c 65 74 |QuickDra|w, Palet|
|00000630| 74 65 73 2c 20 4f 53 49 | 6e 74 66 2c 20 54 6f 6f |tes, OSI|ntf, Too|
|00000640| 6c 49 6e 74 66 2c 0d 09 | 50 61 63 6b 49 6e 74 66 |lIntf,..|PackIntf|
|00000650| 2c 20 50 69 63 6b 65 72 | 2c 20 55 46 61 69 6c 75 |, Picker|, UFailu|
|00000660| 72 65 2c 20 4f 66 66 73 | 63 72 65 65 6e 2c 20 54 |re, Offs|creen, T|
|00000670| 72 61 70 73 3b 0d 0d 43 | 4f 4e 53 54 0d 0d 09 6b |raps;..C|ONST...k|
|00000680| 53 79 73 45 6e 76 69 72 | 6f 6e 73 56 65 72 73 69 |SysEnvir|onsVersi|
|00000690| 6f 6e 09 09 3d 20 31 3b | 0d 0d 09 6b 4f 53 45 76 |on..= 1;|...kOSEv|
|000006a0| 65 6e 74 09 09 09 09 3d | 20 61 70 70 34 45 76 74 |ent....=| app4Evt|
|000006b0| 3b 09 09 7b 65 76 65 6e | 74 20 75 73 65 64 20 62 |;..{even|t used b|
|000006c0| 79 20 4d 75 6c 74 69 46 | 69 6e 64 65 72 7d 0d 09 |y MultiF|inder}..|
|000006d0| 6b 53 75 73 70 65 6e 64 | 52 65 73 75 6d 65 4d 65 |kSuspend|ResumeMe|
|000006e0| 73 73 61 67 65 09 3d 20 | 31 3b 09 09 09 7b 68 69 |ssage.= |1;...{hi|
|000006f0| 67 68 20 62 79 74 65 20 | 6f 66 20 73 75 73 70 65 |gh byte |of suspe|
|00000700| 6e 64 2f 72 65 73 75 6d | 65 20 65 76 65 6e 74 20 |nd/resum|e event |
|00000710| 6d 65 73 73 61 67 65 7d | 0d 09 6b 52 65 73 75 6d |message}|..kResum|
|00000720| 65 4d 61 73 6b 09 09 09 | 09 3d 20 31 3b 09 09 09 |eMask...|.= 1;...|
|00000730| 7b 62 69 74 20 6f 66 20 | 6d 73 67 20 66 69 65 6c |{bit of |msg fiel|
|00000740| 64 20 66 6f 72 20 72 65 | 73 75 6d 65 20 76 73 2e |d for re|sume vs.|
|00000750| 20 73 75 73 70 65 6e 64 | 7d 0d 0d 09 6b 4d 69 6e | suspend|}...kMin|
|00000760| 48 65 61 70 09 09 09 09 | 3d 20 36 36 20 2a 20 31 |Heap....|= 66 * 1|
|00000770| 30 32 34 3b 0d 09 0d 09 | 6b 4d 69 6e 53 70 61 63 |024;....|kMinSpac|
|00000780| 65 09 09 09 09 3d 20 34 | 39 20 2a 20 31 30 32 34 |e....= 4|9 * 1024|
|00000790| 3b 0d 09 0d 09 6b 45 78 | 74 72 65 6d 65 4e 65 67 |;....kEx|tremeNeg|
|000007a0| 09 09 09 09 3d 20 2d 33 | 32 37 36 38 3b 0d 09 6b |....= -3|2768;..k|
|000007b0| 45 78 74 72 65 6d 65 50 | 6f 73 09 09 09 09 3d 20 |ExtremeP|os....= |
|000007c0| 33 32 37 36 37 20 2d 20 | 31 3b 09 7b 72 65 71 75 |32767 - |1;.{requ|
|000007d0| 69 72 65 64 20 66 6f 72 | 20 6f 6c 64 20 72 65 67 |ired for| old reg|
|000007e0| 69 6f 6e 20 62 75 67 7d | 0d 09 0d 09 73 45 72 72 |ion bug}|....sErr|
|000007f0| 53 74 72 69 6e 67 73 09 | 09 09 09 3d 20 31 32 38 |Strings.|...= 128|
|00000800| 3b 09 09 09 7b 65 72 72 | 6f 72 20 73 74 72 69 6e |;...{err|or strin|
|00000810| 67 20 53 54 52 23 7d 0d | 09 65 53 74 61 6e 64 61 |g STR#}.|.eStanda|
|00000820| 72 64 45 72 72 09 09 09 | 3d 20 31 3b 0d 09 65 57 |rdErr...|= 1;..eW|
|00000830| 72 6f 6e 67 4d 61 63 68 | 69 6e 65 09 09 09 3d 20 |rongMach|ine...= |
|00000840| 32 3b 0d 09 65 53 6d 61 | 6c 6c 53 69 7a 65 09 09 |2;..eSma|llSize..|
|00000850| 09 09 3d 20 33 3b 0d 09 | 65 4e 6f 4d 65 6d 6f 72 |..= 3;..|eNoMemor|
|00000860| 79 09 09 09 09 3d 20 34 | 3b 0d 09 0d 09 6b 4e 6f |y....= 4|;....kNo|
|00000870| 42 61 63 6b 42 75 66 66 | 09 09 09 09 3d 20 31 32 |BackBuff|....= 12|
|00000880| 38 3b 0d 09 6b 4e 6f 45 | 64 69 74 42 75 66 66 09 |8;..kNoE|ditBuff.|
|00000890| 09 09 09 3d 20 31 32 39 | 3b 0d 09 6b 54 69 74 6c |...= 129|;..kTitl|
|000008a0| 65 09 09 09 09 09 3d 20 | 31 33 30 3b 0d 09 6b 43 |e.....= |130;..kC|
|000008b0| 6f 6c 6f 72 50 72 6f 6d | 70 74 09 09 09 3d 20 31 |olorProm|pt...= 1|
|000008c0| 33 31 3b 0d 09 6b 4e 6f | 57 61 6e 74 42 61 63 6b |31;..kNo|WantBack|
|000008d0| 09 09 09 09 3d 20 31 33 | 32 3b 0d 09 6b 4e 6f 57 |....= 13|2;..kNoW|
|000008e0| 61 6e 74 45 64 69 74 09 | 09 09 09 3d 20 31 33 33 |antEdit.|...= 133|
|000008f0| 3b 0d 09 0d 09 6b 43 4d | 6f 6f 66 09 09 09 09 09 |;....kCM|oof.....|
|00000900| 3d 20 31 32 38 3b 0d 09 | 6b 47 69 67 61 6e 74 6f |= 128;..|kGiganto|
|00000910| 72 09 09 09 09 3d 20 31 | 32 38 3b 0d 09 6b 31 62 |r....= 1|28;..k1b|
|00000920| 69 74 47 69 67 61 6e 74 | 6f 72 09 09 09 3d 20 31 |itGigant|or...= 1|
|00000930| 32 39 3b 0d 09 0d 09 72 | 4d 65 6e 75 42 61 72 09 |29;....r|MenuBar.|
|00000940| 09 09 09 3d 20 31 32 38 | 3b 09 09 09 7b 61 70 70 |...= 128|;...{app|
|00000950| 6c 69 63 61 74 69 6f 6e | 27 73 20 6d 65 6e 75 20 |lication|'s menu |
|00000960| 62 61 72 7d 0d 09 72 41 | 62 6f 75 74 41 6c 65 72 |bar}..rA|boutAler|
|00000970| 74 09 09 09 09 3d 20 31 | 32 38 3b 09 09 09 7b 61 |t....= 1|28;...{a|
|00000980| 62 6f 75 74 20 61 6c 65 | 72 74 7d 0d 09 72 55 73 |bout ale|rt}..rUs|
|00000990| 65 72 41 6c 65 72 74 09 | 09 09 09 3d 20 31 32 39 |erAlert.|...= 129|
|000009a0| 3b 09 09 09 7b 65 72 72 | 6f 72 20 75 73 65 72 20 |;...{err|or user |
|000009b0| 61 6c 65 72 74 7d 0d 09 | 72 57 69 6e 64 6f 77 09 |alert}..|rWindow.|
|000009c0| 09 09 09 09 3d 20 31 32 | 38 3b 09 09 09 7b 61 70 |....= 12|8;...{ap|
|000009d0| 70 6c 69 63 61 74 69 6f | 6e 27 73 20 77 69 6e 64 |plicatio|n's wind|
|000009e0| 6f 77 7d 0d 0d 09 6d 41 | 70 70 6c 65 09 09 09 09 |ow}...mA|pple....|
|000009f0| 09 3d 20 31 32 38 3b 09 | 09 09 7b 41 70 70 6c 65 |.= 128;.|..{Apple|
|00000a00| 20 6d 65 6e 75 7d 0d 09 | 69 41 62 6f 75 74 09 09 | menu}..|iAbout..|
|00000a10| 09 09 09 3d 20 31 3b 0d | 0d 09 6d 46 69 6c 65 09 |...= 1;.|..mFile.|
|00000a20| 09 09 09 09 3d 20 31 32 | 39 3b 09 09 09 7b 46 69 |....= 12|9;...{Fi|
|00000a30| 6c 65 20 6d 65 6e 75 7d | 0d 09 69 4e 65 77 09 09 |le menu}|..iNew..|
|00000a40| 09 09 09 3d 20 31 3b 0d | 09 69 43 6c 6f 73 65 09 |...= 1;.|.iClose.|
|00000a50| 09 09 09 09 3d 20 34 3b | 0d 09 69 51 75 69 74 09 |....= 4;|..iQuit.|
|00000a60| 09 09 09 09 3d 20 31 32 | 3b 0d 0d 09 6d 45 64 69 |....= 12|;...mEdi|
|00000a70| 74 09 09 09 09 09 3d 20 | 31 33 30 3b 09 09 09 7b |t.....= |130;...{|
|00000a80| 45 64 69 74 20 6d 65 6e | 75 7d 0d 09 69 55 6e 64 |Edit men|u}..iUnd|
|00000a90| 6f 09 09 09 09 09 3d 20 | 31 3b 0d 09 69 43 75 74 |o.....= |1;..iCut|
|00000aa0| 09 09 09 09 09 3d 20 33 | 3b 0d 09 69 43 6f 70 79 |.....= 3|;..iCopy|
|00000ab0| 09 09 09 09 09 3d 20 34 | 3b 0d 09 69 50 61 73 74 |.....= 4|;..iPast|
|00000ac0| 65 09 09 09 09 09 3d 20 | 35 3b 0d 09 69 43 6c 65 |e.....= |5;..iCle|
|00000ad0| 61 72 09 09 09 09 09 3d | 20 36 3b 0d 09 0d 09 6d |ar.....=| 6;....m|
|00000ae0| 53 68 61 70 65 09 09 09 | 09 09 3d 20 31 33 31 3b |Shape...|..= 131;|
|00000af0| 09 09 09 7b 53 68 61 70 | 65 20 6d 65 6e 75 7d 0d |...{Shap|e menu}.|
|00000b00| 09 0d 09 6d 53 70 65 63 | 69 61 6c 09 09 09 09 3d |...mSpec|ial....=|
|00000b10| 20 31 33 32 3b 09 09 09 | 7b 53 70 65 63 69 61 6c | 132;...|{Special|
|00000b20| 20 6d 65 6e 75 7d 0d 09 | 69 55 73 65 42 61 63 6b | menu}..|iUseBack|
|00000b30| 09 09 09 09 3d 20 31 3b | 0d 09 69 55 73 65 45 64 |....= 1;|..iUseEd|
|00000b40| 69 74 09 09 09 09 3d 20 | 32 3b 0d 09 69 50 69 63 |it....= |2;..iPic|
|00000b50| 6b 43 6f 6c 6f 72 09 09 | 09 09 3d 20 34 3b 0d 0d |kColor..|..= 4;..|
|00000b60| 09 6b 44 49 54 6f 70 09 | 09 09 09 09 3d 20 24 30 |.kDITop.|....= $0|
|00000b70| 30 35 30 3b 0d 09 6b 44 | 49 4c 65 66 74 09 09 09 |050;..kD|ILeft...|
|00000b80| 09 09 3d 20 24 30 30 37 | 30 3b 0d 09 0d 09 6b 4e |..= $007|0;....kN|
|00000b90| 6f 74 44 72 61 77 6e 09 | 09 09 09 3d 20 2d 31 3b |otDrawn.|...= -1;|
|00000ba0| 0d 09 6b 4c 61 73 74 4f | 6e 65 09 09 09 09 3d 20 |..kLastO|ne....= |
|00000bb0| 2d 32 3b 0d 09 0d 09 6b | 43 75 72 73 6f 72 44 65 |-2;....k|CursorDe|
|00000bc0| 70 74 68 09 09 09 3d 20 | 32 3b 0d 09 6b 4d 65 6d |pth...= |2;..kMem|
|00000bd0| 6f 72 79 50 6f 6c 69 74 | 65 09 09 09 3d 20 54 52 |oryPolit|e...= TR|
|00000be0| 55 45 3b 0d 09 0d 09 6b | 46 72 61 6d 65 50 65 6e |UE;....k|FramePen|
|00000bf0| 48 09 09 09 09 3d 20 32 | 3b 0d 09 6b 46 72 61 6d |H....= 2|;..kFram|
|00000c00| 65 50 65 6e 56 09 09 09 | 09 3d 20 32 3b 0d 09 0d |ePenV...|.= 2;...|
|00000c10| 09 0d 54 59 50 45 0d 0d | 09 53 68 61 70 65 73 09 |..TYPE..|.Shapes.|
|00000c20| 09 09 3d 20 28 6b 4f 76 | 61 6c 2c 20 6b 52 65 67 |..= (kOv|al, kReg|
|00000c30| 69 6f 6e 2c 20 6b 52 52 | 65 63 74 2c 20 6b 50 6f |ion, kRR|ect, kPo|
|00000c40| 6c 79 2c 20 6b 52 65 63 | 74 2c 20 6b 49 43 4f 4e |ly, kRec|t, kICON|
|00000c50| 2c 20 6b 50 49 43 54 29 | 3b 0d 0d 09 53 68 61 70 |, kPICT)|;...Shap|
|00000c60| 65 52 65 63 6f 72 64 09 | 09 3d 20 52 45 43 4f 52 |eRecord.|.= RECOR|
|00000c70| 44 0d 09 09 6e 65 78 74 | 09 09 09 3a 20 53 68 61 |D...next|...: Sha|
|00000c80| 70 65 73 3b 09 09 7b 77 | 68 65 6e 20 69 73 20 69 |pes;..{w|hen is i|
|00000c90| 74 20 64 72 61 77 6e 3f | 7d 0d 09 09 65 78 74 65 |t drawn?|}...exte|
|00000ca0| 6e 74 09 09 09 3a 20 52 | 65 63 74 3b 09 09 09 7b |nt...: R|ect;...{|
|00000cb0| 77 68 65 72 65 20 69 73 | 20 69 74 3f 7d 0d 09 45 |where is| it?}..E|
|00000cc0| 4e 44 3b 0d 09 09 09 09 | 09 0d 09 53 68 61 70 65 |ND;.....|...Shape|
|00000cd0| 41 72 72 61 79 09 09 3d | 20 41 52 52 41 59 20 5b |Array..=| ARRAY [|
|00000ce0| 53 68 61 70 65 73 5d 20 | 4f 46 20 53 68 61 70 65 |Shapes] |OF Shape|
|00000cf0| 52 65 63 6f 72 64 3b 0d | 09 0d 09 7b 41 6e 20 4f |Record;.|...{An O|
|00000d00| 66 66 73 63 72 65 65 6e | 52 65 63 6f 72 64 20 63 |ffscreen|Record c|
|00000d10| 6f 6e 74 61 69 6e 73 20 | 74 68 65 20 57 69 6e 64 |ontains |the Wind|
|00000d20| 6f 77 52 65 63 6f 72 64 | 20 66 6f 72 20 6f 6e 65 |owRecord| for one|
|00000d30| 20 6f 66 20 6f 75 72 20 | 73 61 6d 70 6c 65 20 77 | of our |sample w|
|00000d40| 69 6e 64 6f 77 73 2c 0d | 09 20 61 73 20 77 65 6c |indows,.|. as wel|
|00000d50| 6c 20 61 73 20 61 6e 20 | 6f 66 66 73 63 72 65 65 |l as an |offscree|
|00000d60| 6e 20 68 61 6e 64 6c 65 | 20 66 6f 72 20 74 68 65 |n handle| for the|
|00000d70| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 61 6e 64 20 | backgro|und and |
|00000d80| 61 6e 20 6f 66 66 73 63 | 72 65 65 6e 20 68 61 6e |an offsc|reen han|
|00000d90| 64 6c 65 0d 09 20 66 6f | 72 20 74 68 65 20 62 61 |dle.. fo|r the ba|
|00000da0| 63 6b 67 72 6f 75 6e 64 | 20 70 6c 75 73 20 74 68 |ckground| plus th|
|00000db0| 65 20 73 68 61 70 65 20 | 62 65 69 6e 67 20 63 72 |e shape |being cr|
|00000dc0| 65 61 74 65 64 2e 20 49 | 74 20 61 6c 73 6f 20 68 |eated. I|t also h|
|00000dd0| 61 73 20 61 6e 20 61 72 | 72 61 79 20 6f 66 0d 09 |as an ar|ray of..|
|00000de0| 20 73 68 61 70 65 73 20 | 66 6f 72 20 74 68 69 73 | shapes |for this|
|00000df0| 20 77 69 6e 64 6f 77 2c | 20 61 20 70 6f 69 6e 74 | window,| a point|
|00000e00| 65 72 20 74 6f 20 74 68 | 65 20 66 69 72 73 74 20 |er to th|e first |
|00000e10| 73 68 61 70 65 2c 20 61 | 20 70 6f 69 6e 74 65 72 |shape, a| pointer|
|00000e20| 20 74 6f 20 74 68 65 0d | 09 20 73 68 61 70 65 20 | to the.|. shape |
|00000e30| 62 65 69 6e 67 20 65 64 | 69 74 65 64 2c 20 61 6e |being ed|ited, an|
|00000e40| 64 20 61 20 72 65 63 6f | 72 64 20 6f 66 20 74 68 |d a reco|rd of th|
|00000e50| 65 20 6c 61 73 74 20 73 | 74 61 74 65 20 6f 66 20 |e last s|tate of |
|00000e60| 74 68 65 20 62 75 66 66 | 65 72 73 2e 20 46 6f 72 |the buff|ers. For|
|00000e70| 20 61 0d 09 20 73 69 6d | 69 6c 61 72 20 65 78 61 | a.. sim|ilar exa|
|00000e80| 6d 70 6c 65 20 6f 66 20 | 65 78 74 65 6e 64 69 6e |mple of |extendin|
|00000e90| 67 20 61 20 74 6f 6f 6c | 62 6f 78 20 64 61 74 61 |g a tool|box data|
|00000ea0| 20 73 74 72 75 63 74 75 | 72 65 2c 20 73 65 65 20 | structu|re, see |
|00000eb0| 68 6f 77 20 74 68 65 20 | 57 69 6e 64 6f 77 0d 09 |how the |Window..|
|00000ec0| 20 4d 61 6e 61 67 65 72 | 20 61 6e 64 20 44 69 61 | Manager| and Dia|
|00000ed0| 6c 6f 67 20 4d 61 6e 61 | 67 65 72 20 61 64 64 20 |log Mana|ger add |
|00000ee0| 66 69 65 6c 64 73 20 74 | 6f 20 74 68 65 20 47 72 |fields t|o the Gr|
|00000ef0| 61 66 50 6f 72 74 20 61 | 6e 64 20 57 69 6e 64 6f |afPort a|nd Windo|
|00000f00| 77 52 65 63 6f 72 64 2c | 0d 09 20 72 65 73 70 65 |wRecord,|.. respe|
|00000f10| 63 74 69 76 65 6c 79 2e | 7d 0d 09 20 0d 09 4f 66 |ctively.|}.. ..Of|
|00000f20| 66 73 63 72 65 65 6e 52 | 65 63 6f 72 64 09 3d 20 |fscreenR|ecord.= |
|00000f30| 52 45 43 4f 52 44 0d 09 | 09 66 57 69 6e 64 6f 77 |RECORD..|.fWindow|
|00000f40| 09 09 3a 20 57 69 6e 64 | 6f 77 52 65 63 6f 72 64 |..: Wind|owRecord|
|00000f50| 3b 09 09 7b 77 69 6e 64 | 6f 77 20 64 61 74 61 20 |;..{wind|ow data |
|00000f60| 73 74 72 75 63 74 75 72 | 65 20 66 6f 72 20 74 6f |structur|e for to|
|00000f70| 6f 6c 62 6f 78 20 75 73 | 65 7d 0d 09 09 66 42 61 |olbox us|e}...fBa|
|00000f80| 63 6b 48 61 6e 64 6c 65 | 09 3a 20 48 61 6e 64 6c |ckHandle|.: Handl|
|00000f90| 65 3b 09 09 09 7b 6f 66 | 66 73 63 72 65 65 6e 20 |e;...{of|fscreen |
|00000fa0| 70 69 78 6d 61 70 20 74 | 68 61 74 20 68 6f 6c 64 |pixmap t|hat hold|
|00000fb0| 73 20 62 61 63 6b 67 72 | 6f 75 6e 64 7d 0d 09 09 |s backgr|ound}...|
|00000fc0| 66 45 64 69 74 48 61 6e | 64 6c 65 09 3a 20 48 61 |fEditHan|dle.: Ha|
|00000fd0| 6e 64 6c 65 3b 09 09 09 | 7b 70 69 78 6d 61 70 20 |ndle;...|{pixmap |
|00000fe0| 66 6f 72 20 62 61 63 6b | 67 72 6f 75 6e 64 20 61 |for back|ground a|
|00000ff0| 6e 64 20 73 68 61 70 65 | 20 62 65 69 6e 67 20 63 |nd shape| being c|
|00001000| 72 65 61 74 65 64 7d 0d | 09 09 66 53 68 61 70 65 |reated}.|..fShape|
|00001010| 73 09 09 3a 20 53 68 61 | 70 65 41 72 72 61 79 3b |s..: Sha|peArray;|
|00001020| 09 09 7b 74 68 65 20 73 | 68 61 70 65 73 20 66 6f |..{the s|hapes fo|
|00001030| 72 20 74 68 69 73 20 77 | 69 6e 64 6f 77 7d 0d 09 |r this w|indow}..|
|00001040| 09 66 46 69 72 73 74 09 | 09 3a 20 53 68 61 70 65 |.fFirst.|.: Shape|
|00001050| 73 3b 09 09 09 7b 77 68 | 6f 20 69 73 20 66 69 72 |s;...{wh|o is fir|
|00001060| 73 74 3f 7d 0d 09 09 66 | 45 64 69 74 09 09 3a 20 |st?}...f|Edit..: |
|00001070| 53 68 61 70 65 73 3b 09 | 09 09 7b 77 68 6f 20 69 |Shapes;.|..{who i|
|00001080| 73 20 62 65 69 6e 67 20 | 65 64 69 74 65 64 3f 7d |s being |edited?}|
|00001090| 0d 09 09 66 48 61 73 42 | 61 63 6b 09 3a 20 42 4f |...fHasB|ack.: BO|
|000010a0| 4f 4c 45 41 4e 3b 09 09 | 09 7b 64 69 64 20 69 74 |OLEAN;..|.{did it|
|000010b0| 20 68 61 76 65 20 61 20 | 62 61 63 6b 67 72 6f 75 | have a |backgrou|
|000010c0| 6e 64 20 62 75 66 66 65 | 72 20 6c 61 73 74 20 74 |nd buffe|r last t|
|000010d0| 69 6d 65 3f 7d 0d 09 09 | 66 48 61 73 45 64 69 74 |ime?}...|fHasEdit|
|000010e0| 09 3a 20 42 4f 4f 4c 45 | 41 4e 3b 09 09 09 7b 64 |.: BOOLE|AN;...{d|
|000010f0| 69 64 20 69 74 20 68 61 | 76 65 20 61 20 65 64 69 |id it ha|ve a edi|
|00001100| 74 20 62 75 66 66 65 72 | 20 6c 61 73 74 20 74 69 |t buffer| last ti|
|00001110| 6d 65 3f 7d 0d 09 45 4e | 44 3b 0d 09 4f 66 66 73 |me?}..EN|D;..Offs|
|00001120| 63 72 65 65 6e 50 65 65 | 6b 09 3d 20 5e 4f 66 66 |creenPee|k.= ^Off|
|00001130| 73 63 72 65 65 6e 52 65 | 63 6f 72 64 3b 0d 0d 0d |screenRe|cord;...|
|00001140| 56 41 52 0d 09 7b 54 68 | 65 20 22 67 22 20 70 72 |VAR..{Th|e "g" pr|
|00001150| 65 66 69 78 20 69 73 20 | 75 73 65 64 20 74 6f 20 |efix is |used to |
|00001160| 65 6d 70 68 61 73 69 7a | 65 20 74 68 61 74 20 61 |emphasiz|e that a|
|00001170| 20 76 61 72 69 61 62 6c | 65 20 69 73 20 67 6c 6f | variabl|e is glo|
|00001180| 62 61 6c 2e 7d 0d 0d 09 | 67 4d 61 63 09 09 09 09 |bal.}...|gMac....|
|00001190| 3a 20 53 79 73 45 6e 76 | 52 65 63 3b 09 7b 73 65 |: SysEnv|Rec;.{se|
|000011a0| 74 20 75 70 20 62 79 20 | 49 6e 69 74 69 61 6c 69 |t up by |Initiali|
|000011b0| 7a 65 7d 0d 09 67 48 61 | 73 57 61 69 74 4e 65 78 |ze}..gHa|sWaitNex|
|000011c0| 74 45 76 65 6e 74 09 3a | 20 42 4f 4f 4c 45 41 4e |tEvent.:| BOOLEAN|
|000011d0| 3b 09 09 7b 73 65 74 20 | 75 70 20 62 79 20 49 6e |;..{set |up by In|
|000011e0| 69 74 69 61 6c 69 7a 65 | 7d 0d 09 67 49 6e 42 61 |itialize|}..gInBa|
|000011f0| 63 6b 67 72 6f 75 6e 64 | 09 09 3a 20 42 4f 4f 4c |ckground|..: BOOL|
|00001200| 45 41 4e 3b 09 09 7b 6d | 61 69 6e 74 61 69 6e 65 |EAN;..{m|aintaine|
|00001210| 64 20 62 79 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |d by Ini|tialize |
|00001220| 61 6e 64 20 44 6f 45 76 | 65 6e 74 7d 0d 09 0d 09 |and DoEv|ent}....|
|00001230| 67 53 68 61 70 65 09 09 | 09 09 3a 20 53 68 61 70 |gShape..|..: Shap|
|00001240| 65 73 3b 09 09 7b 63 75 | 72 72 65 6e 74 20 73 68 |es;..{cu|rrent sh|
|00001250| 61 70 65 7d 0d 09 67 55 | 73 65 42 61 63 6b 09 09 |ape}..gU|seBack..|
|00001260| 09 3a 20 42 4f 4f 4c 45 | 41 4e 3b 09 09 7b 63 72 |.: BOOLE|AN;..{cr|
|00001270| 65 61 74 65 20 62 61 63 | 6b 67 72 6f 75 6e 64 20 |eate bac|kground |
|00001280| 6f 66 66 73 63 72 65 65 | 6e 20 66 6c 61 67 7d 0d |offscree|n flag}.|
|00001290| 09 67 55 73 65 45 64 69 | 74 09 09 09 3a 20 42 4f |.gUseEdi|t...: BO|
|000012a0| 4f 4c 45 41 4e 3b 09 09 | 7b 63 72 65 61 74 65 20 |OLEAN;..|{create |
|000012b0| 65 64 69 74 20 6f 66 66 | 73 63 72 65 65 6e 20 66 |edit off|screen f|
|000012c0| 6c 61 67 7d 0d 09 67 43 | 75 72 73 6f 72 09 09 09 |lag}..gC|ursor...|
|000012d0| 09 3a 20 43 43 72 73 72 | 48 61 6e 64 6c 65 3b 09 |.: CCrsr|Handle;.|
|000012e0| 7b 74 68 65 72 65 20 63 | 61 6e 20 62 65 20 4f 4e |{there c|an be ON|
|000012f0| 4c 59 20 6f 6e 65 7d 0d | 09 67 4f 75 67 68 48 61 |LY one}.|.gOughHa|
|00001300| 6e 64 6c 65 09 09 09 3a | 20 48 61 6e 64 6c 65 3b |ndle...:| Handle;|
|00001310| 09 09 7b 6f 66 66 73 63 | 72 65 65 6e 20 68 61 6e |..{offsc|reen han|
|00001320| 64 6c 65 20 66 6f 72 20 | 63 6f 6c 6f 72 20 63 75 |dle for |color cu|
|00001330| 72 73 6f 72 7d 0d 09 67 | 50 49 43 54 09 09 09 09 |rsor}..g|PICT....|
|00001340| 3a 20 50 69 63 48 61 6e | 64 6c 65 3b 09 7b 47 69 |: PicHan|dle;.{Gi|
|00001350| 67 61 6e 74 6f 72 7d 0d | 09 67 63 69 63 6e 09 09 |gantor}.|.gcicn..|
|00001360| 09 09 3a 20 43 49 63 6f | 6e 48 61 6e 64 6c 65 3b |..: CIco|nHandle;|
|00001370| 09 7b 4d 6f 6f 66 21 aa | 7d 0d 09 67 31 42 69 74 |.{Moof!.|}..g1Bit|
|00001380| 48 61 6e 64 6c 65 09 09 | 09 3a 20 48 61 6e 64 6c |Handle..|.: Handl|
|00001390| 65 3b 09 09 7b 66 6f 72 | 20 74 68 65 20 63 6f 6c |e;..{for| the col|
|000013a0| 6f 72 20 63 75 72 73 6f | 72 20 6d 61 73 6b 7d 0d |or curso|r mask}.|
|000013b0| 0d 0d 7b 24 53 20 49 6e | 69 74 69 61 6c 69 7a 65 |..{$S In|itialize|
|000013c0| 7d 0d 46 55 4e 43 54 49 | 4f 4e 20 54 72 61 70 41 |}.FUNCTI|ON TrapA|
|000013d0| 76 61 69 6c 61 62 6c 65 | 28 74 4e 75 6d 62 65 72 |vailable|(tNumber|
|000013e0| 3a 20 49 4e 54 45 47 45 | 52 3b 20 74 54 79 70 65 |: INTEGE|R; tType|
|000013f0| 3a 20 54 72 61 70 54 79 | 70 65 29 3a 20 42 4f 4f |: TrapTy|pe): BOO|
|00001400| 4c 45 41 4e 3b 0d 0d 7b | 43 68 65 63 6b 20 74 6f |LEAN;..{|Check to|
|00001410| 20 73 65 65 20 69 66 20 | 61 20 67 69 76 65 6e 20 | see if |a given |
|00001420| 74 72 61 70 20 69 73 20 | 69 6d 70 6c 65 6d 65 6e |trap is |implemen|
|00001430| 74 65 64 2e 20 54 68 69 | 73 20 69 73 20 6f 6e 6c |ted. Thi|s is onl|
|00001440| 79 20 75 73 65 64 20 62 | 79 20 74 68 65 0d 20 49 |y used b|y the. I|
|00001450| 6e 69 74 69 61 6c 69 7a | 65 20 72 6f 75 74 69 6e |nitializ|e routin|
|00001460| 65 20 69 6e 20 74 68 69 | 73 20 70 72 6f 67 72 61 |e in thi|s progra|
|00001470| 6d 2c 20 73 6f 20 77 65 | 20 70 75 74 20 69 74 20 |m, so we| put it |
|00001480| 69 6e 20 74 68 65 20 49 | 6e 69 74 69 61 6c 69 7a |in the I|nitializ|
|00001490| 65 20 73 65 67 6d 65 6e | 74 2e 0d 20 54 68 65 20 |e segmen|t.. The |
|000014a0| 72 65 63 6f 6d 6d 65 6e | 64 65 64 20 61 70 70 72 |recommen|ded appr|
|000014b0| 6f 61 63 68 20 74 6f 20 | 73 65 65 20 69 66 20 61 |oach to |see if a|
|000014c0| 20 74 72 61 70 20 69 73 | 20 69 6d 70 6c 65 6d 65 | trap is| impleme|
|000014d0| 6e 74 65 64 20 69 73 20 | 74 6f 20 73 65 65 20 69 |nted is |to see i|
|000014e0| 66 0d 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |f. the a|ddress o|
|000014f0| 66 20 74 68 65 20 74 72 | 61 70 20 72 6f 75 74 69 |f the tr|ap routi|
|00001500| 6e 65 20 69 73 20 74 68 | 65 20 73 61 6d 65 20 61 |ne is th|e same a|
|00001510| 73 20 74 68 65 20 61 64 | 64 72 65 73 73 20 6f 66 |s the ad|dress of|
|00001520| 20 74 68 65 0d 20 55 6e | 69 6d 70 6c 65 6d 65 6e | the. Un|implemen|
|00001530| 74 65 64 20 74 72 61 70 | 2e 20 4e 65 65 64 73 20 |ted trap|. Needs |
|00001540| 74 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 61 66 74 |to be ca|lled aft|
|00001550| 65 72 20 63 61 6c 6c 20 | 74 6f 20 53 79 73 45 6e |er call |to SysEn|
|00001560| 76 69 72 6f 6e 73 20 73 | 6f 20 74 68 61 74 0d 20 |virons s|o that. |
|00001570| 69 74 20 63 61 6e 20 63 | 68 65 63 6b 20 69 66 20 |it can c|heck if |
|00001580| 61 20 54 6f 6f 6c 54 72 | 61 70 20 69 73 20 6f 75 |a ToolTr|ap is ou|
|00001590| 74 20 6f 66 20 72 61 6e | 67 65 20 6f 66 20 61 20 |t of ran|ge of a |
|000015a0| 70 72 65 2d 4d 61 63 49 | 49 20 52 4f 4d 2e 7d 0d |pre-MacI|I ROM.}.|
|000015b0| 0d 42 45 47 49 4e 0d 09 | 49 46 20 28 74 54 79 70 |.BEGIN..|IF (tTyp|
|000015c0| 65 20 3d 20 54 6f 6f 6c | 54 72 61 70 29 20 26 0d |e = Tool|Trap) &.|
|000015d0| 09 09 28 67 4d 61 63 2e | 6d 61 63 68 69 6e 65 54 |..(gMac.|machineT|
|000015e0| 79 70 65 20 3e 20 65 6e | 76 4d 61 63 68 55 6e 6b |ype > en|vMachUnk|
|000015f0| 6e 6f 77 6e 29 20 26 0d | 09 09 28 67 4d 61 63 2e |nown) &.|..(gMac.|
|00001600| 6d 61 63 68 69 6e 65 54 | 79 70 65 20 3c 20 65 6e |machineT|ype < en|
|00001610| 76 4d 61 63 49 49 29 20 | 54 48 45 4e 20 42 45 47 |vMacII) |THEN BEG|
|00001620| 49 4e 09 09 7b 69 74 27 | 73 20 61 20 35 31 32 4b |IN..{it'|s a 512K|
|00001630| 45 2c 20 50 6c 75 73 2c | 20 6f 72 20 53 45 7d 0d |E, Plus,| or SE}.|
|00001640| 09 09 74 4e 75 6d 62 65 | 72 20 3a 3d 20 42 41 4e |..tNumbe|r := BAN|
|00001650| 44 28 74 4e 75 6d 62 65 | 72 2c 20 24 30 33 46 46 |D(tNumbe|r, $03FF|
|00001660| 29 3b 0d 09 09 49 46 20 | 74 4e 75 6d 62 65 72 20 |);...IF |tNumber |
|00001670| 3e 20 24 30 31 46 46 20 | 54 48 45 4e 09 09 09 09 |> $01FF |THEN....|
|00001680| 09 09 09 7b 77 68 69 63 | 68 20 6d 65 61 6e 73 20 |...{whic|h means |
|00001690| 74 68 65 20 74 6f 6f 6c | 20 74 72 61 70 73 7d 0d |the tool| traps}.|
|000016a0| 09 09 09 74 4e 75 6d 62 | 65 72 20 3a 3d 20 5f 55 |...tNumb|er := _U|
|000016b0| 6e 69 6d 70 6c 65 6d 65 | 6e 74 65 64 3b 09 09 09 |nimpleme|nted;...|
|000016c0| 09 09 7b 6f 6e 6c 79 20 | 67 6f 20 74 6f 20 24 30 |..{only |go to $0|
|000016d0| 31 46 46 7d 0d 09 45 4e | 44 3b 0d 09 54 72 61 70 |1FF}..EN|D;..Trap|
|000016e0| 41 76 61 69 6c 61 62 6c | 65 20 3a 3d 20 4e 47 65 |Availabl|e := NGe|
|000016f0| 74 54 72 61 70 41 64 64 | 72 65 73 73 28 74 4e 75 |tTrapAdd|ress(tNu|
|00001700| 6d 62 65 72 2c 20 74 54 | 79 70 65 29 20 3c 3e 0d |mber, tT|ype) <>.|
|00001710| 09 09 09 09 09 09 47 65 | 74 54 72 61 70 41 64 64 |......Ge|tTrapAdd|
|00001720| 72 65 73 73 28 5f 55 6e | 69 6d 70 6c 65 6d 65 6e |ress(_Un|implemen|
|00001730| 74 65 64 29 3b 0d 45 4e | 44 3b 20 7b 54 72 61 70 |ted);.EN|D; {Trap|
|00001740| 41 76 61 69 6c 61 62 6c | 65 7d 0d 0d 0d 7b 24 53 |Availabl|e}...{$S|
|00001750| 20 4d 61 69 6e 7d 0d 50 | 52 4f 43 45 44 55 52 45 | Main}.P|ROCEDURE|
|00001760| 20 47 65 74 47 6c 6f 62 | 61 6c 52 65 63 74 20 28 | GetGlob|alRect (|
|00001770| 77 69 6e 64 6f 77 3a 20 | 57 69 6e 64 6f 77 50 74 |window: |WindowPt|
|00001780| 72 3b 20 56 41 52 20 67 | 6c 6f 62 61 6c 52 65 63 |r; VAR g|lobalRec|
|00001790| 74 3a 20 52 65 63 74 29 | 3b 0d 0d 7b 52 65 74 75 |t: Rect)|;..{Retu|
|000017a0| 72 6e 20 74 68 65 20 70 | 6f 72 74 52 65 63 74 20 |rn the p|ortRect |
|000017b0| 6f 66 20 77 69 6e 64 6f | 77 20 69 6e 20 67 6c 6f |of windo|w in glo|
|000017c0| 62 61 6c 20 63 6f 6f 72 | 64 69 6e 61 74 65 73 2e |bal coor|dinates.|
|000017d0| 7d 0d 0d 56 41 52 0d 09 | 73 61 76 65 50 6f 72 74 |}..VAR..|savePort|
|000017e0| 09 3a 20 47 72 61 66 50 | 74 72 3b 0d 09 0d 42 45 |.: GrafP|tr;...BE|
|000017f0| 47 49 4e 0d 09 47 65 74 | 50 6f 72 74 28 73 61 76 |GIN..Get|Port(sav|
|00001800| 65 50 6f 72 74 29 3b 0d | 09 53 65 74 50 6f 72 74 |ePort);.|.SetPort|
|00001810| 28 77 69 6e 64 6f 77 29 | 3b 09 09 09 09 09 7b 73 |(window)|;.....{s|
|00001820| 6f 20 74 68 61 74 20 74 | 68 65 20 63 6f 72 72 65 |o that t|he corre|
|00001830| 63 74 20 7d 0d 09 67 6c | 6f 62 61 6c 52 65 63 74 |ct }..gl|obalRect|
|00001840| 20 3a 3d 20 77 69 6e 64 | 6f 77 5e 2e 70 6f 72 74 | := wind|ow^.port|
|00001850| 52 65 63 74 3b 09 09 7b | 20 63 6f 6f 72 64 69 6e |Rect;..{| coordin|
|00001860| 61 74 65 20 73 79 73 74 | 65 6d 20 69 73 20 75 73 |ate syst|em is us|
|00001870| 65 64 7d 0d 09 57 49 54 | 48 20 67 6c 6f 62 61 6c |ed}..WIT|H global|
|00001880| 52 65 63 74 20 44 4f 20 | 42 45 47 49 4e 0d 09 09 |Rect DO |BEGIN...|
|00001890| 4c 6f 63 61 6c 54 6f 47 | 6c 6f 62 61 6c 28 74 6f |LocalToG|lobal(to|
|000018a0| 70 4c 65 66 74 29 3b 0d | 09 09 4c 6f 63 61 6c 54 |pLeft);.|..LocalT|
|000018b0| 6f 47 6c 6f 62 61 6c 28 | 62 6f 74 52 69 67 68 74 |oGlobal(|botRight|
|000018c0| 29 3b 0d 09 45 4e 44 3b | 0d 09 53 65 74 50 6f 72 |);..END;|..SetPor|
|000018d0| 74 28 73 61 76 65 50 6f | 72 74 29 3b 0d 45 4e 44 |t(savePo|rt);.END|
|000018e0| 3b 20 7b 47 65 74 47 6c | 6f 62 61 6c 52 65 63 74 |; {GetGl|obalRect|
|000018f0| 7d 0d 0d 0d 7b 24 53 20 | 4d 61 69 6e 7d 0d 46 55 |}...{$S |Main}.FU|
|00001900| 4e 43 54 49 4f 4e 20 49 | 73 44 41 57 69 6e 64 6f |NCTION I|sDAWindo|
|00001910| 77 20 28 77 69 6e 64 6f | 77 3a 20 57 69 6e 64 6f |w (windo|w: Windo|
|00001920| 77 50 74 72 29 3a 20 42 | 4f 4f 4c 45 41 4e 3b 0d |wPtr): B|OOLEAN;.|
|00001930| 0d 7b 43 68 65 63 6b 20 | 69 66 20 61 20 77 69 6e |.{Check |if a win|
|00001940| 64 6f 77 20 62 65 6c 6f | 6e 67 73 20 74 6f 20 61 |dow belo|ngs to a|
|00001950| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 79 2e | desk ac|cessory.|
|00001960| 7d 0d 0d 42 45 47 49 4e | 0d 09 49 46 20 77 69 6e |}..BEGIN|..IF win|
|00001970| 64 6f 77 20 3d 20 4e 49 | 4c 20 54 48 45 4e 0d 09 |dow = NI|L THEN..|
|00001980| 09 49 73 44 41 57 69 6e | 64 6f 77 20 3a 3d 20 46 |.IsDAWin|dow := F|
|00001990| 41 4c 53 45 0d 09 45 4c | 53 45 09 7b 44 41 20 77 |ALSE..EL|SE.{DA w|
|000019a0| 69 6e 64 6f 77 73 20 68 | 61 76 65 20 6e 65 67 61 |indows h|ave nega|
|000019b0| 74 69 76 65 20 77 69 6e | 64 6f 77 4b 69 6e 64 73 |tive win|dowKinds|
|000019c0| 7d 0d 09 09 49 73 44 41 | 57 69 6e 64 6f 77 20 3a |}...IsDA|Window :|
|000019d0| 3d 20 57 69 6e 64 6f 77 | 50 65 65 6b 28 77 69 6e |= Window|Peek(win|
|000019e0| 64 6f 77 29 5e 2e 77 69 | 6e 64 6f 77 4b 69 6e 64 |dow)^.wi|ndowKind|
|000019f0| 20 3c 20 30 3b 0d 45 4e | 44 3b 20 7b 49 73 44 41 | < 0;.EN|D; {IsDA|
|00001a00| 57 69 6e 64 6f 77 7d 0d | 0d 0d 7b 24 53 20 4d 61 |Window}.|..{$S Ma|
|00001a10| 69 6e 7d 0d 46 55 4e 43 | 54 49 4f 4e 20 49 73 41 |in}.FUNC|TION IsA|
|00001a20| 70 70 57 69 6e 64 6f 77 | 20 28 77 69 6e 64 6f 77 |ppWindow| (window|
|00001a30| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3a 20 42 4f |: Window|Ptr): BO|
|00001a40| 4f 4c 45 41 4e 3b 0d 0d | 7b 43 68 65 63 6b 20 74 |OLEAN;..|{Check t|
|00001a50| 6f 20 73 65 65 20 69 66 | 20 61 20 77 69 6e 64 6f |o see if| a windo|
|00001a60| 77 20 62 65 6c 6f 6e 67 | 73 20 74 6f 20 74 68 65 |w belong|s to the|
|00001a70| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2e 20 49 66 | applica|tion. If|
|00001a80| 20 74 68 65 20 77 69 6e | 64 6f 77 20 70 6f 69 6e | the win|dow poin|
|00001a90| 74 65 72 0d 20 70 61 73 | 73 65 64 20 77 61 73 20 |ter. pas|sed was |
|00001aa0| 4e 49 4c 2c 20 74 68 65 | 6e 20 69 74 20 63 6f 75 |NIL, the|n it cou|
|00001ab0| 6c 64 20 6e 6f 74 20 62 | 65 20 61 6e 20 61 70 70 |ld not b|e an app|
|00001ac0| 6c 69 63 61 74 69 6f 6e | 20 77 69 6e 64 6f 77 2e |lication| window.|
|00001ad0| 20 57 69 6e 64 6f 77 4b | 69 6e 64 73 0d 20 74 68 | WindowK|inds. th|
|00001ae0| 61 74 20 61 72 65 20 6e | 65 67 61 74 69 76 65 20 |at are n|egative |
|00001af0| 62 65 6c 6f 6e 67 20 74 | 6f 20 74 68 65 20 73 79 |belong t|o the sy|
|00001b00| 73 74 65 6d 20 61 6e 64 | 20 77 69 6e 64 6f 77 4b |stem and| windowK|
|00001b10| 69 6e 64 73 20 6c 65 73 | 73 20 74 68 61 6e 20 75 |inds les|s than u|
|00001b20| 73 65 72 4b 69 6e 64 0d | 20 61 72 65 20 72 65 73 |serKind.| are res|
|00001b30| 65 72 76 65 64 20 62 79 | 20 41 70 70 6c 65 20 65 |erved by| Apple e|
|00001b40| 78 63 65 70 74 20 66 6f | 72 20 77 69 6e 64 6f 77 |xcept fo|r window|
|00001b50| 4b 69 6e 64 73 20 65 71 | 75 61 6c 20 74 6f 20 64 |Kinds eq|ual to d|
|00001b60| 69 61 6c 6f 67 4b 69 6e | 64 2c 20 77 68 69 63 68 |ialogKin|d, which|
|00001b70| 0d 20 6d 65 61 6e 20 69 | 74 20 69 73 20 61 20 64 |. mean i|t is a d|
|00001b80| 69 61 6c 6f 67 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |ialog.}.|.BEGIN..|
|00001b90| 49 46 20 77 69 6e 64 6f | 77 20 3d 20 4e 49 4c 20 |IF windo|w = NIL |
|00001ba0| 54 48 45 4e 0d 09 09 49 | 73 41 70 70 57 69 6e 64 |THEN...I|sAppWind|
|00001bb0| 6f 77 20 3a 3d 20 46 41 | 4c 53 45 0d 09 45 4c 53 |ow := FA|LSE..ELS|
|00001bc0| 45 09 7b 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 77 |E.{appli|cation w|
|00001bd0| 69 6e 64 6f 77 73 20 68 | 61 76 65 20 77 69 6e 64 |indows h|ave wind|
|00001be0| 6f 77 4b 69 6e 64 73 20 | 3e 3d 20 75 73 65 72 4b |owKinds |>= userK|
|00001bf0| 69 6e 64 20 28 38 29 7d | 0d 09 09 57 49 54 48 20 |ind (8)}|...WITH |
|00001c00| 57 69 6e 64 6f 77 50 65 | 65 6b 28 77 69 6e 64 6f |WindowPe|ek(windo|
|00001c10| 77 29 5e 20 44 4f 0d 09 | 09 09 49 73 41 70 70 57 |w)^ DO..|..IsAppW|
|00001c20| 69 6e 64 6f 77 20 3a 3d | 20 28 77 69 6e 64 6f 77 |indow :=| (window|
|00001c30| 4b 69 6e 64 20 3d 20 75 | 73 65 72 4b 69 6e 64 29 |Kind = u|serKind)|
|00001c40| 3b 0d 45 4e 44 3b 20 7b | 49 73 41 70 70 57 69 6e |;.END; {|IsAppWin|
|00001c50| 64 6f 77 7d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |dow}...{|$S Main}|
|00001c60| 0d 50 52 4f 43 45 44 55 | 52 45 20 46 61 69 6c 4e |.PROCEDU|RE FailN|
|00001c70| 49 4c 4d 73 67 28 70 3a | 20 55 4e 49 56 20 50 74 |ILMsg(p:| UNIV Pt|
|00001c80| 72 3b 20 6d 65 73 73 61 | 67 65 3a 20 49 4e 54 45 |r; messa|ge: INTE|
|00001c90| 47 45 52 29 3b 0d 0d 7b | 43 68 65 63 6b 20 66 6f |GER);..{|Check fo|
|00001ca0| 72 20 4e 49 4c 20 70 20 | 61 6e 64 20 66 61 69 6c |r NIL p |and fail|
|00001cb0| 20 69 66 20 73 6f 2e 7d | 0d 0d 42 45 47 49 4e 0d | if so.}|..BEGIN.|
|00001cc0| 09 49 46 20 70 20 3d 20 | 4e 49 4c 20 54 48 45 4e |.IF p = |NIL THEN|
|00001cd0| 0d 09 09 46 61 69 6c 75 | 72 65 28 6d 65 6d 46 75 |...Failu|re(memFu|
|00001ce0| 6c 6c 45 72 72 2c 20 6d | 65 73 73 61 67 65 29 3b |llErr, m|essage);|
|00001cf0| 0d 45 4e 44 3b 20 7b 46 | 61 69 6c 4e 49 4c 4d 73 |.END; {F|ailNILMs|
|00001d00| 67 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |g}...{$S| Main}.P|
|00001d10| 52 4f 43 45 44 55 52 45 | 20 41 6c 65 72 74 55 73 |ROCEDURE| AlertUs|
|00001d20| 65 72 28 65 72 72 6f 72 | 3a 20 49 4e 54 45 47 45 |er(error|: INTEGE|
|00001d30| 52 3b 20 6d 65 73 73 61 | 67 65 3a 20 4c 6f 6e 67 |R; messa|ge: Long|
|00001d40| 49 6e 74 29 3b 0d 0d 7b | 44 69 73 70 6c 61 79 20 |Int);..{|Display |
|00001d50| 61 6e 20 61 6c 65 72 74 | 20 74 6f 20 69 6e 66 6f |an alert| to info|
|00001d60| 72 6d 20 74 68 65 20 75 | 73 65 72 20 6f 66 20 61 |rm the u|ser of a|
|00001d70| 6e 20 65 72 72 6f 72 2e | 20 4d 65 73 73 61 67 65 |n error.| Message|
|00001d80| 20 61 63 74 73 20 61 73 | 20 61 6e 20 0d 20 69 6e | acts as| an . in|
|00001d90| 64 65 78 20 69 6e 74 6f | 20 61 20 53 54 52 23 20 |dex into| a STR# |
|00001da0| 72 65 73 6f 75 72 63 65 | 20 6f 66 20 65 72 72 6f |resource| of erro|
|00001db0| 72 20 6d 65 73 73 61 67 | 65 73 2e 20 49 66 20 6e |r messag|es. If n|
|00001dc0| 6f 20 6d 65 73 73 61 67 | 65 20 69 73 20 67 69 76 |o messag|e is giv|
|00001dd0| 65 6e 2c 0d 20 69 2e 65 | 2e 20 3d 20 30 2c 20 74 |en,. i.e|. = 0, t|
|00001de0| 68 65 6e 20 75 73 65 20 | 61 20 73 74 61 6e 64 61 |hen use |a standa|
|00001df0| 72 64 20 6d 65 73 73 61 | 67 65 2e 20 49 66 20 65 |rd messa|ge. If e|
|00001e00| 72 72 6f 72 20 69 73 20 | 6e 6f 74 20 6e 6f 45 72 |rror is |not noEr|
|00001e10| 72 20 74 68 65 6e 0d 20 | 64 69 73 70 6c 61 79 20 |r then. |display |
|00001e20| 69 74 20 61 73 20 77 65 | 6c 6c 2e 7d 0d 0d 56 41 |it as we|ll.}..VA|
|00001e30| 52 0d 09 6d 73 67 31 2c | 20 6d 73 67 32 09 3a 20 |R..msg1,| msg2.: |
|00001e40| 53 74 72 32 35 35 3b 0d | 09 69 74 65 6d 48 69 74 |Str255;.|.itemHit|
|00001e50| 09 09 3a 20 49 4e 54 45 | 47 45 52 3b 0d 42 45 47 |..: INTE|GER;.BEG|
|00001e60| 49 4e 0d 09 49 46 20 6d | 65 73 73 61 67 65 20 3d |IN..IF m|essage =|
|00001e70| 20 30 20 54 48 45 4e 20 | 6d 65 73 73 61 67 65 20 | 0 THEN |message |
|00001e80| 3a 3d 20 65 53 74 61 6e | 64 61 72 64 45 72 72 3b |:= eStan|dardErr;|
|00001e90| 0d 09 47 65 74 49 6e 64 | 53 74 72 69 6e 67 28 6d |..GetInd|String(m|
|00001ea0| 73 67 31 2c 20 73 45 72 | 72 53 74 72 69 6e 67 73 |sg1, sEr|rStrings|
|00001eb0| 2c 20 6d 65 73 73 61 67 | 65 29 3b 0d 09 49 46 20 |, messag|e);..IF |
|00001ec0| 65 72 72 6f 72 20 3d 20 | 6e 6f 45 72 72 20 54 48 |error = |noErr TH|
|00001ed0| 45 4e 0d 09 09 6d 73 67 | 32 20 3a 3d 20 27 27 0d |EN...msg|2 := ''.|
|00001ee0| 09 45 4c 53 45 0d 09 09 | 4e 75 6d 54 6f 53 74 72 |.ELSE...|NumToStr|
|00001ef0| 69 6e 67 28 65 72 72 6f | 72 2c 20 6d 73 67 32 29 |ing(erro|r, msg2)|
|00001f00| 3b 0d 09 50 61 72 61 6d | 54 65 78 74 28 6d 73 67 |;..Param|Text(msg|
|00001f10| 31 2c 20 6d 73 67 32 2c | 20 27 27 2c 20 27 27 29 |1, msg2,| '', '')|
|00001f20| 3b 0d 09 69 74 65 6d 48 | 69 74 20 3a 3d 20 41 6c |;..itemH|it := Al|
|00001f30| 65 72 74 28 72 55 73 65 | 72 41 6c 65 72 74 2c 20 |ert(rUse|rAlert, |
|00001f40| 4e 49 4c 29 3b 0d 45 4e | 44 3b 20 7b 41 6c 65 72 |NIL);.EN|D; {Aler|
|00001f50| 74 55 73 65 72 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |tUser}..|.{$S Mai|
|00001f60| 6e 7d 0d 46 55 4e 43 54 | 49 4f 4e 20 44 6f 43 6c |n}.FUNCT|ION DoCl|
|00001f70| 6f 73 65 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |oseWindo|w(window|
|00001f80| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 20 3a 20 42 |: Window|Ptr) : B|
|00001f90| 4f 4f 4c 45 41 4e 3b 0d | 0d 7b 43 6c 6f 73 65 20 |OOLEAN;.|.{Close |
|00001fa0| 61 20 77 69 6e 64 6f 77 | 2e 7d 0d 0d 7b 41 74 20 |a window|.}..{At |
|00001fb0| 74 68 69 73 20 70 6f 69 | 6e 74 2c 20 69 66 20 74 |this poi|nt, if t|
|00001fc0| 68 65 72 65 20 77 61 73 | 20 61 20 64 6f 63 75 6d |here was| a docum|
|00001fd0| 65 6e 74 20 61 73 73 6f | 63 69 61 74 65 64 20 77 |ent asso|ciated w|
|00001fe0| 69 74 68 20 61 0d 20 77 | 69 6e 64 6f 77 2c 20 79 |ith a. w|indow, y|
|00001ff0| 6f 75 20 63 6f 75 6c 64 | 20 64 6f 20 61 6e 79 20 |ou could| do any |
|00002000| 64 6f 63 75 6d 65 6e 74 | 20 73 61 76 69 6e 67 20 |document| saving |
|00002010| 70 72 6f 63 65 73 73 69 | 6e 67 20 69 66 20 69 74 |processi|ng if it|
|00002020| 20 69 73 20 27 64 69 72 | 74 79 27 2e 0d 20 44 6f | is 'dir|ty'.. Do|
|00002030| 43 6c 6f 73 65 57 69 6e | 64 6f 77 20 77 6f 75 6c |CloseWin|dow woul|
|00002040| 64 20 72 65 74 75 72 6e | 20 54 52 55 45 20 69 66 |d return| TRUE if|
|00002050| 20 74 68 65 20 77 69 6e | 64 6f 77 20 61 63 74 75 | the win|dow actu|
|00002060| 61 6c 6c 79 20 63 6c 6f | 73 65 73 2c 20 69 2e 65 |ally clo|ses, i.e|
|00002070| 2e 2c 0d 20 74 68 65 20 | 75 73 65 72 20 64 6f 65 |.,. the |user doe|
|00002080| 73 20 6e 6f 74 20 63 61 | 6e 63 65 6c 20 66 72 6f |s not ca|ncel fro|
|00002090| 6d 20 61 20 73 61 76 65 | 20 64 69 61 6c 6f 67 2e |m a save| dialog.|
|000020a0| 20 54 68 69 73 20 72 65 | 73 75 6c 74 20 69 73 20 | This re|sult is |
|000020b0| 68 61 6e 64 79 20 77 68 | 65 6e 0d 20 74 68 65 20 |handy wh|en. the |
|000020c0| 75 73 65 72 20 71 75 69 | 74 73 20 61 6e 20 61 70 |user qui|ts an ap|
|000020d0| 70 6c 69 63 61 74 69 6f | 6e 2c 20 62 75 74 20 74 |plicatio|n, but t|
|000020e0| 68 65 6e 20 63 61 6e 63 | 65 6c 73 20 61 20 73 61 |hen canc|els a sa|
|000020f0| 76 65 20 6f 66 20 61 20 | 64 6f 63 75 6d 65 6e 74 |ve of a |document|
|00002100| 0d 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |. associ|ated wit|
|00002110| 68 20 61 20 77 69 6e 64 | 6f 77 2e 20 57 65 20 61 |h a wind|ow. We a|
|00002120| 6c 73 6f 20 61 64 64 65 | 64 20 63 6f 64 65 20 74 |lso adde|d code t|
|00002130| 6f 20 63 6c 6f 73 65 20 | 74 68 65 20 61 70 70 6c |o close |the appl|
|00002140| 69 63 61 74 69 6f 6e 0d | 20 77 69 6e 64 6f 77 20 |ication.| window |
|00002150| 73 69 6e 63 65 20 6f 74 | 68 65 72 77 69 73 65 2c |since ot|herwise,|
|00002160| 20 74 68 65 20 74 65 72 | 6d 69 6e 61 74 69 6f 6e | the ter|mination|
|00002170| 20 72 6f 75 74 69 6e 65 | 73 20 77 6f 75 6c 64 20 | routine|s would |
|00002180| 6e 65 76 65 72 20 73 74 | 6f 70 20 6c 6f 6f 70 69 |never st|op loopi|
|00002190| 6e 67 2c 0d 20 77 61 69 | 74 69 6e 67 20 66 6f 72 |ng,. wai|ting for|
|000021a0| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 20 74 6f 20 | FrontWi|ndow to |
|000021b0| 72 65 74 75 72 6e 20 4e | 49 4c 2e 7d 0d 20 0d 56 |return N|IL.}. .V|
|000021c0| 41 52 0d 09 70 61 6c 09 | 3a 20 50 61 6c 65 74 74 |AR..pal.|: Palett|
|000021d0| 65 48 61 6e 64 6c 65 3b | 0d 0d 42 45 47 49 4e 0d |eHandle;|..BEGIN.|
|000021e0| 09 44 6f 43 6c 6f 73 65 | 57 69 6e 64 6f 77 20 3a |.DoClose|Window :|
|000021f0| 3d 20 54 52 55 45 3b 0d | 09 49 46 20 49 73 44 41 |= TRUE;.|.IF IsDA|
|00002200| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 29 20 54 |Window(w|indow) T|
|00002210| 48 45 4e 0d 09 09 43 6c | 6f 73 65 44 65 73 6b 41 |HEN...Cl|oseDeskA|
|00002220| 63 63 28 57 69 6e 64 6f | 77 50 65 65 6b 28 77 69 |cc(Windo|wPeek(wi|
|00002230| 6e 64 6f 77 29 5e 2e 77 | 69 6e 64 6f 77 4b 69 6e |ndow)^.w|indowKin|
|00002240| 64 29 3b 0d 09 49 46 20 | 49 73 41 70 70 57 69 6e |d);..IF |IsAppWin|
|00002250| 64 6f 77 28 77 69 6e 64 | 6f 77 29 20 54 48 45 4e |dow(wind|ow) THEN|
|00002260| 20 42 45 47 49 4e 0d 09 | 09 57 49 54 48 20 4f 66 | BEGIN..|.WITH Of|
|00002270| 66 73 63 72 65 65 6e 50 | 65 65 6b 28 77 69 6e 64 |fscreenP|eek(wind|
|00002280| 6f 77 29 5e 20 44 4f 20 | 42 45 47 49 4e 0d 09 09 |ow)^ DO |BEGIN...|
|00002290| 09 44 69 73 70 6f 73 65 | 4f 66 66 73 63 72 65 65 |.Dispose|Offscree|
|000022a0| 6e 28 66 42 61 63 6b 48 | 61 6e 64 6c 65 29 3b 0d |n(fBackH|andle);.|
|000022b0| 09 09 09 44 69 73 70 6f | 73 65 4f 66 66 73 63 72 |...Dispo|seOffscr|
|000022c0| 65 65 6e 28 66 45 64 69 | 74 48 61 6e 64 6c 65 29 |een(fEdi|tHandle)|
|000022d0| 3b 0d 09 09 45 4e 44 3b | 0d 09 09 49 46 20 67 4d |;...END;|...IF gM|
|000022e0| 61 63 2e 68 61 73 43 6f | 6c 6f 72 51 44 20 54 48 |ac.hasCo|lorQD TH|
|000022f0| 45 4e 20 42 45 47 49 4e | 0d 09 09 09 70 61 6c 20 |EN BEGIN|....pal |
|00002300| 3a 3d 20 47 65 74 50 61 | 6c 65 74 74 65 28 77 69 |:= GetPa|lette(wi|
|00002310| 6e 64 6f 77 29 3b 09 09 | 09 7b 57 65 20 6d 75 73 |ndow);..|.{We mus|
|00002320| 74 20 68 61 6e 64 6c 65 | 20 74 68 69 73 20 6f 75 |t handle| this ou|
|00002330| 72 73 65 6c 76 65 73 2c | 7d 0d 09 09 09 44 69 73 |rselves,|}....Dis|
|00002340| 70 6f 73 65 50 61 6c 65 | 74 74 65 28 70 61 6c 29 |posePale|tte(pal)|
|00002350| 3b 09 09 09 09 7b 73 69 | 6e 63 65 20 77 65 20 6d |;....{si|nce we m|
|00002360| 61 79 20 68 61 76 65 20 | 64 6f 6e 65 20 61 20 47 |ay have |done a G|
|00002370| 65 74 50 61 6c 65 74 74 | 65 2e 7d 0d 09 09 45 4e |etPalett|e.}...EN|
|00002380| 44 3b 0d 09 09 43 6c 6f | 73 65 57 69 6e 64 6f 77 |D;...Clo|seWindow|
|00002390| 28 77 69 6e 64 6f 77 29 | 3b 09 09 09 09 09 7b 53 |(window)|;.....{S|
|000023a0| 69 6e 63 65 20 77 65 20 | 70 72 6f 76 69 64 65 64 |ince we |provided|
|000023b0| 20 6f 75 72 20 6f 77 6e | 20 73 74 6f 72 61 67 65 | our own| storage|
|000023c0| 2e 7d 0d 09 09 44 69 73 | 70 6f 73 50 74 72 28 50 |.}...Dis|posPtr(P|
|000023d0| 74 72 28 77 69 6e 64 6f | 77 29 29 3b 0d 09 45 4e |tr(windo|w));..EN|
|000023e0| 44 3b 0d 45 4e 44 3b 20 | 7b 44 6f 43 6c 6f 73 65 |D;.END; |{DoClose|
|000023f0| 57 69 6e 64 6f 77 7d 0d | 0d 0d 7b 24 53 20 4d 61 |Window}.|..{$S Ma|
|00002400| 69 6e 7d 0d 50 52 4f 43 | 45 44 55 52 45 20 45 66 |in}.PROC|EDURE Ef|
|00002410| 66 69 63 69 65 6e 74 43 | 6f 6e 63 61 74 32 20 28 |ficientC|oncat2 (|
|00002420| 56 41 52 20 73 74 72 69 | 6e 67 31 2c 20 73 74 72 |VAR stri|ng1, str|
|00002430| 69 6e 67 32 3a 20 53 74 | 72 32 35 35 29 3b 0d 0d |ing2: St|r255);..|
|00002440| 7b 44 6f 20 61 20 6d 6f | 72 65 20 65 66 66 69 63 |{Do a mo|re effic|
|00002450| 69 65 6e 74 20 63 6f 6e | 63 61 74 20 74 68 61 6e |ient con|cat than|
|00002460| 20 43 4f 4e 43 41 54 20 | 73 69 6e 63 65 20 77 65 | CONCAT |since we|
|00002470| 20 6b 6e 6f 77 0d 20 74 | 68 65 72 65 20 61 72 65 | know. t|here are|
|00002480| 20 6f 6e 6c 79 20 74 77 | 6f 20 73 74 72 69 6e 67 | only tw|o string|
|00002490| 73 2e 7d 0d 0d 56 41 52 | 0d 09 6c 65 6e 31 2c 20 |s.}..VAR|..len1, |
|000024a0| 6c 65 6e 32 09 3a 20 49 | 4e 54 45 47 45 52 3b 0d |len2.: I|NTEGER;.|
|000024b0| 09 0d 42 45 47 49 4e 0d | 09 6c 65 6e 31 20 3a 3d |..BEGIN.|.len1 :=|
|000024c0| 20 4c 45 4e 47 54 48 28 | 73 74 72 69 6e 67 31 29 | LENGTH(|string1)|
|000024d0| 3b 0d 09 49 46 20 6c 65 | 6e 31 20 3c 20 32 35 35 |;..IF le|n1 < 255|
|000024e0| 20 54 48 45 4e 20 42 45 | 47 49 4e 0d 09 09 6c 65 | THEN BE|GIN...le|
|000024f0| 6e 32 20 3a 3d 20 4c 45 | 4e 47 54 48 28 73 74 72 |n2 := LE|NGTH(str|
|00002500| 69 6e 67 32 29 3b 0d 09 | 09 49 46 20 6c 65 6e 31 |ing2);..|.IF len1|
|00002510| 20 2b 20 6c 65 6e 32 20 | 3e 20 32 35 35 20 54 48 | + len2 |> 255 TH|
|00002520| 45 4e 0d 09 09 09 6c 65 | 6e 32 20 3a 3d 20 32 35 |EN....le|n2 := 25|
|00002530| 35 20 2d 20 6c 65 6e 31 | 3b 0d 09 09 42 6c 6f 63 |5 - len1|;...Bloc|
|00002540| 6b 4d 6f 76 65 28 40 73 | 74 72 69 6e 67 32 5b 31 |kMove(@s|tring2[1|
|00002550| 5d 2c 20 40 73 74 72 69 | 6e 67 31 5b 31 20 2b 20 |], @stri|ng1[1 + |
|00002560| 6c 65 6e 31 5d 2c 20 6c | 65 6e 32 29 3b 0d 09 09 |len1], l|en2);...|
|00002570| 73 74 72 69 6e 67 31 5b | 30 5d 20 3a 3d 20 43 48 |string1[|0] := CH|
|00002580| 52 28 6c 65 6e 31 20 2b | 20 6c 65 6e 32 29 3b 0d |R(len1 +| len2);.|
|00002590| 09 45 4e 44 3b 0d 45 4e | 44 3b 20 7b 45 66 66 69 |.END;.EN|D; {Effi|
|000025a0| 63 69 65 6e 74 43 6f 6e | 63 61 74 32 7d 0d 0d 0d |cientCon|cat2}...|
|000025b0| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|000025c0| 55 52 45 20 41 70 70 65 | 6e 64 54 69 74 6c 65 20 |URE Appe|ndTitle |
|000025d0| 28 56 41 52 20 74 69 74 | 6c 65 3a 20 53 74 72 32 |(VAR tit|le: Str2|
|000025e0| 35 35 3b 20 69 64 3a 20 | 49 4e 54 45 47 45 52 29 |55; id: |INTEGER)|
|000025f0| 3b 0d 0d 7b 41 70 70 65 | 6e 64 20 74 68 65 20 73 |;..{Appe|nd the s|
|00002600| 70 65 63 69 66 69 65 64 | 20 73 74 72 69 6e 67 20 |pecified| string |
|00002610| 72 65 73 6f 75 72 63 65 | 20 64 61 74 61 20 74 6f |resource| data to|
|00002620| 20 74 68 65 20 70 72 6f | 76 69 64 65 64 0d 20 73 | the pro|vided. s|
|00002630| 74 72 69 6e 67 2e 7d 0d | 0d 0d 56 41 52 0d 09 61 |tring.}.|..VAR..a|
|00002640| 53 74 72 69 6e 67 09 3a | 20 53 74 72 69 6e 67 48 |String.:| StringH|
|00002650| 61 6e 64 6c 65 3b 0d 09 | 0d 42 45 47 49 4e 0d 09 |andle;..|.BEGIN..|
|00002660| 61 53 74 72 69 6e 67 20 | 3a 3d 20 47 65 74 53 74 |aString |:= GetSt|
|00002670| 72 69 6e 67 28 69 64 29 | 3b 0d 09 49 46 20 61 53 |ring(id)|;..IF aS|
|00002680| 74 72 69 6e 67 20 3c 3e | 20 4e 49 4c 20 54 48 45 |tring <>| NIL THE|
|00002690| 4e 20 42 45 47 49 4e 0d | 09 09 48 4c 6f 63 6b 28 |N BEGIN.|..HLock(|
|000026a0| 48 61 6e 64 6c 65 28 61 | 53 74 72 69 6e 67 29 29 |Handle(a|String))|
|000026b0| 3b 09 09 09 09 7b 69 6e | 20 63 61 73 65 20 45 66 |;....{in| case Ef|
|000026c0| 66 69 63 69 65 6e 74 43 | 6f 6e 63 61 74 32 20 69 |ficientC|oncat2 i|
|000026d0| 73 7d 0d 09 09 45 66 66 | 69 63 69 65 6e 74 43 6f |s}...Eff|icientCo|
|000026e0| 6e 63 61 74 32 28 74 69 | 74 6c 65 2c 20 61 53 74 |ncat2(ti|tle, aSt|
|000026f0| 72 69 6e 67 5e 5e 29 3b | 0d 09 09 48 55 6e 6c 6f |ring^^);|...HUnlo|
|00002700| 63 6b 28 48 61 6e 64 6c | 65 28 61 53 74 72 69 6e |ck(Handl|e(aStrin|
|00002710| 67 29 29 3b 09 09 09 7b | 69 6e 20 61 20 64 69 66 |g));...{|in a dif|
|00002720| 66 65 72 65 6e 74 20 73 | 65 67 6d 65 6e 74 7d 0d |ferent s|egment}.|
|00002730| 09 45 4e 44 3b 0d 45 4e | 44 3b 20 7b 41 70 70 65 |.END;.EN|D; {Appe|
|00002740| 6e 64 54 69 74 6c 65 7d | 0d 0d 0d 7b 24 53 20 4d |ndTitle}|...{$S M|
|00002750| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 43 |ain}.PRO|CEDURE C|
|00002760| 68 65 63 6b 54 69 74 6c | 65 20 28 77 69 6e 64 6f |heckTitl|e (windo|
|00002770| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 64 6f |w: Windo|wPtr; do|
|00002780| 43 68 65 63 6b 3a 20 42 | 4f 4f 4c 45 41 4e 29 3b |Check: B|OOLEAN);|
|00002790| 0d 0d 7b 43 6f 6d 70 61 | 72 65 20 74 68 65 20 70 |..{Compa|re the p|
|000027a0| 72 69 6f 72 20 73 74 61 | 74 65 20 6f 66 20 74 68 |rior sta|te of th|
|000027b0| 65 20 6f 66 66 73 63 72 | 65 65 6e 20 68 61 6e 64 |e offscr|een hand|
|000027c0| 6c 65 73 20 66 6f 72 0d | 20 77 69 6e 64 6f 77 20 |les for.| window |
|000027d0| 61 6e 64 20 63 68 61 6e | 67 65 20 69 74 73 20 74 |and chan|ge its t|
|000027e0| 69 74 6c 65 20 74 6f 20 | 72 65 66 6c 65 63 74 20 |itle to |reflect |
|000027f0| 74 68 65 20 6e 65 77 20 | 73 74 61 74 65 2e 7d 0d |the new |state.}.|
|00002800| 0d 56 41 52 0d 09 61 53 | 74 72 69 6e 67 09 09 09 |.VAR..aS|tring...|
|00002810| 09 3a 20 53 74 72 69 6e | 67 48 61 6e 64 6c 65 3b |.: Strin|gHandle;|
|00002820| 0d 09 74 69 74 6c 65 09 | 09 09 09 3a 20 53 74 72 |..title.|...: Str|
|00002830| 32 35 35 3b 0d 09 68 61 | 73 42 61 63 6b 2c 20 68 |255;..ha|sBack, h|
|00002840| 61 73 45 64 69 74 09 3a | 20 42 4f 4f 4c 45 41 4e |asEdit.:| BOOLEAN|
|00002850| 3b 0d 0d 42 45 47 49 4e | 0d 09 49 46 20 49 73 41 |;..BEGIN|..IF IsA|
|00002860| 70 70 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 29 |ppWindow|(window)|
|00002870| 20 54 48 45 4e 0d 09 09 | 57 49 54 48 20 4f 66 66 | THEN...|WITH Off|
|00002880| 73 63 72 65 65 6e 50 65 | 65 6b 28 77 69 6e 64 6f |screenPe|ek(windo|
|00002890| 77 29 5e 20 44 4f 20 42 | 45 47 49 4e 0d 09 09 09 |w)^ DO B|EGIN....|
|000028a0| 68 61 73 42 61 63 6b 20 | 3a 3d 20 28 47 65 74 4d |hasBack |:= (GetM|
|000028b0| 61 70 28 66 42 61 63 6b | 48 61 6e 64 6c 65 29 20 |ap(fBack|Handle) |
|000028c0| 3c 3e 20 4e 49 4c 29 3b | 0d 09 09 09 68 61 73 45 |<> NIL);|....hasE|
|000028d0| 64 69 74 20 3a 3d 20 28 | 47 65 74 4d 61 70 28 66 |dit := (|GetMap(f|
|000028e0| 45 64 69 74 48 61 6e 64 | 6c 65 29 20 3c 3e 20 4e |EditHand|le) <> N|
|000028f0| 49 4c 29 3b 0d 09 09 09 | 49 46 20 28 4e 4f 54 20 |IL);....|IF (NOT |
|00002900| 64 6f 43 68 65 63 6b 29 | 20 7c 09 09 09 09 09 7b |doCheck)| |.....{|
|00002910| 73 65 74 20 74 69 74 6c | 65 20 72 65 67 61 72 64 |set titl|e regard|
|00002920| 6c 65 73 73 7d 0d 09 09 | 09 28 66 48 61 73 42 61 |less}...|.(fHasBa|
|00002930| 63 6b 20 3c 3e 20 68 61 | 73 42 61 63 6b 29 20 7c |ck <> ha|sBack) ||
|00002940| 09 09 09 09 7b 6f 72 20 | 69 66 20 63 68 61 6e 67 |....{or |if chang|
|00002950| 65 7d 0d 09 09 09 28 66 | 48 61 73 45 64 69 74 20 |e}....(f|HasEdit |
|00002960| 3c 3e 20 68 61 73 45 64 | 69 74 29 20 54 48 45 4e |<> hasEd|it) THEN|
|00002970| 20 42 45 47 49 4e 09 7b | 69 6e 20 62 75 66 66 65 | BEGIN.{|in buffe|
|00002980| 72 73 7d 0d 09 09 09 09 | 66 48 61 73 42 61 63 6b |rs}.....|fHasBack|
|00002990| 20 3a 3d 20 68 61 73 42 | 61 63 6b 3b 0d 09 09 09 | := hasB|ack;....|
|000029a0| 09 66 48 61 73 45 64 69 | 74 20 3a 3d 20 68 61 73 |.fHasEdi|t := has|
|000029b0| 45 64 69 74 3b 0d 09 09 | 09 09 74 69 74 6c 65 20 |Edit;...|..title |
|000029c0| 3a 3d 20 27 27 3b 0d 09 | 09 09 09 61 53 74 72 69 |:= '';..|...aStri|
|000029d0| 6e 67 20 3a 3d 20 47 65 | 74 53 74 72 69 6e 67 28 |ng := Ge|tString(|
|000029e0| 6b 54 69 74 6c 65 29 3b | 0d 09 09 09 09 49 46 20 |kTitle);|.....IF |
|000029f0| 61 53 74 72 69 6e 67 20 | 3c 3e 20 4e 49 4c 20 54 |aString |<> NIL T|
|00002a00| 48 45 4e 0d 09 09 09 09 | 09 74 69 74 6c 65 20 3a |HEN.....|.title :|
|00002a10| 3d 20 61 53 74 72 69 6e | 67 5e 5e 3b 0d 09 09 09 |= aStrin|g^^;....|
|00002a20| 09 09 0d 09 09 09 09 7b | 49 66 20 61 6e 20 6f 66 |.......{|If an of|
|00002a30| 66 73 63 72 65 65 6e 20 | 68 61 6e 64 6c 65 20 69 |fscreen |handle i|
|00002a40| 73 20 4e 49 4c 2c 20 69 | 74 20 6d 65 61 6e 73 0d |s NIL, i|t means.|
|00002a50| 09 09 09 09 20 74 68 61 | 74 20 74 68 65 20 63 72 |.... tha|t the cr|
|00002a60| 65 61 74 69 6f 6e 20 6f | 66 20 74 68 61 74 20 6f |eation o|f that o|
|00002a70| 66 66 73 63 72 65 65 6e | 20 68 61 6e 64 6c 65 0d |ffscreen| handle.|
|00002a80| 09 09 09 09 20 77 61 73 | 20 64 69 73 61 62 6c 65 |.... was| disable|
|00002a90| 64 20 62 79 20 74 68 65 | 20 75 73 65 72 2e 20 4f |d by the| user. O|
|00002aa0| 6e 63 65 20 74 68 61 74 | 20 69 73 0d 09 09 09 09 |nce that| is.....|
|00002ab0| 20 64 6f 6e 65 2c 20 74 | 68 65 20 62 75 66 66 65 | done, t|he buffe|
|00002ac0| 72 20 77 69 6c 6c 20 6e | 65 76 65 72 20 62 65 20 |r will n|ever be |
|00002ad0| 63 72 65 61 74 65 64 2e | 7d 0d 09 09 09 09 0d 09 |created.|}.......|
|00002ae0| 09 09 09 49 46 20 66 42 | 61 63 6b 48 61 6e 64 6c |...IF fB|ackHandl|
|00002af0| 65 20 3d 20 4e 49 4c 20 | 54 48 45 4e 0d 09 09 09 |e = NIL |THEN....|
|00002b00| 09 09 41 70 70 65 6e 64 | 54 69 74 6c 65 28 74 69 |..Append|Title(ti|
|00002b10| 74 6c 65 2c 20 6b 4e 6f | 57 61 6e 74 42 61 63 6b |tle, kNo|WantBack|
|00002b20| 29 0d 09 09 09 09 45 4c | 53 45 20 49 46 20 4e 4f |).....EL|SE IF NO|
|00002b30| 54 20 68 61 73 42 61 63 | 6b 20 54 48 45 4e 0d 09 |T hasBac|k THEN..|
|00002b40| 09 09 09 09 41 70 70 65 | 6e 64 54 69 74 6c 65 28 |....Appe|ndTitle(|
|00002b50| 74 69 74 6c 65 2c 20 6b | 4e 6f 42 61 63 6b 42 75 |title, k|NoBackBu|
|00002b60| 66 66 29 3b 0d 09 09 09 | 09 49 46 20 66 45 64 69 |ff);....|.IF fEdi|
|00002b70| 74 48 61 6e 64 6c 65 20 | 3d 20 4e 49 4c 20 54 48 |tHandle |= NIL TH|
|00002b80| 45 4e 0d 09 09 09 09 09 | 41 70 70 65 6e 64 54 69 |EN......|AppendTi|
|00002b90| 74 6c 65 28 74 69 74 6c | 65 2c 20 6b 4e 6f 57 61 |tle(titl|e, kNoWa|
|00002ba0| 6e 74 45 64 69 74 29 0d | 09 09 09 09 45 4c 53 45 |ntEdit).|....ELSE|
|00002bb0| 20 49 46 20 4e 4f 54 20 | 68 61 73 45 64 69 74 20 | IF NOT |hasEdit |
|00002bc0| 54 48 45 4e 0d 09 09 09 | 09 09 41 70 70 65 6e 64 |THEN....|..Append|
|00002bd0| 54 69 74 6c 65 28 74 69 | 74 6c 65 2c 20 6b 4e 6f |Title(ti|tle, kNo|
|00002be0| 45 64 69 74 42 75 66 66 | 29 3b 0d 09 09 09 09 53 |EditBuff|);.....S|
|00002bf0| 65 74 57 54 69 74 6c 65 | 28 77 69 6e 64 6f 77 2c |etWTitle|(window,|
|00002c00| 20 74 69 74 6c 65 29 3b | 0d 09 09 09 45 4e 44 3b | title);|....END;|
|00002c10| 0d 09 09 45 4e 44 3b 0d | 45 4e 44 3b 20 7b 43 68 |...END;.|END; {Ch|
|00002c20| 65 63 6b 54 69 74 6c 65 | 7d 0d 0d 0d 7b 24 53 20 |eckTitle|}...{$S |
|00002c30| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|00002c40| 44 72 61 77 53 68 61 70 | 65 20 28 73 68 61 70 65 |DrawShap|e (shape|
|00002c50| 3a 20 53 68 61 70 65 73 | 3b 20 56 41 52 20 65 78 |: Shapes|; VAR ex|
|00002c60| 74 65 6e 74 3a 20 52 65 | 63 74 29 3b 0d 0d 7b 44 |tent: Re|ct);..{D|
|00002c70| 72 61 77 20 74 68 65 20 | 73 68 61 70 65 20 73 70 |raw the |shape sp|
|00002c80| 65 63 69 66 69 65 64 20 | 69 6e 20 74 68 65 20 65 |ecified |in the e|
|00002c90| 78 74 65 6e 74 2e 20 45 | 78 74 65 6e 74 20 69 73 |xtent. E|xtent is|
|00002ca0| 20 61 20 56 41 52 0d 20 | 70 61 72 61 6d 65 74 65 | a VAR. |paramete|
|00002cb0| 72 20 62 65 63 61 75 73 | 65 20 74 68 65 20 72 65 |r becaus|e the re|
|00002cc0| 67 69 6f 6e 20 61 6e 64 | 20 70 6f 6c 79 67 6f 6e |gion and| polygon|
|00002cd0| 20 61 72 65 20 67 65 6e | 65 72 61 74 65 64 0d 20 | are gen|erated. |
|00002ce0| 66 72 6f 6d 20 74 68 65 | 20 65 78 74 65 6e 74 20 |from the| extent |
|00002cf0| 72 65 63 74 20 61 6e 64 | 20 74 68 65 20 63 61 6c |rect and| the cal|
|00002d00| 63 75 6c 61 74 69 6f 6e | 73 20 6d 69 67 68 74 20 |culation|s might |
|00002d10| 72 65 73 75 6c 74 0d 20 | 69 6e 20 61 20 66 69 6e |result. |in a fin|
|00002d20| 61 6c 20 73 68 61 70 65 | 20 6c 61 72 67 65 72 20 |al shape| larger |
|00002d30| 74 68 61 6e 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |than the| origina|
|00002d40| 6c 20 65 78 74 65 6e 74 | 2e 7d 0d 0d 09 50 52 4f |l extent|.}...PRO|
|00002d50| 43 45 44 55 52 45 20 44 | 6f 52 65 67 69 6f 6e 3b |CEDURE D|oRegion;|
|00002d60| 0d 09 0d 09 7b 47 65 6e | 65 72 61 74 65 20 61 20 |....{Gen|erate a |
|00002d70| 72 65 67 69 6f 6e 20 62 | 61 73 65 64 20 6f 6e 20 |region b|ased on |
|00002d80| 74 68 65 20 65 78 74 65 | 6e 74 2e 7d 0d 09 0d 09 |the exte|nt.}....|
|00002d90| 56 41 52 0d 09 09 72 09 | 09 3a 20 52 65 63 74 3b |VAR...r.|.: Rect;|
|00002da0| 0d 09 09 72 48 61 6e 64 | 6c 65 09 3a 20 52 67 6e |...rHand|le.: Rgn|
|00002db0| 48 61 6e 64 6c 65 3b 0d | 09 09 70 48 61 6e 64 6c |Handle;.|..pHandl|
|00002dc0| 65 09 3a 20 50 6f 6c 79 | 48 61 6e 64 6c 65 3b 0d |e.: Poly|Handle;.|
|00002dd0| 09 09 0d 09 42 45 47 49 | 4e 0d 09 09 72 20 3a 3d |....BEGI|N...r :=|
|00002de0| 20 65 78 74 65 6e 74 3b | 0d 09 09 72 48 61 6e 64 | extent;|...rHand|
|00002df0| 6c 65 20 3a 3d 20 4e 65 | 77 52 67 6e 3b 0d 09 09 |le := Ne|wRgn;...|
|00002e00| 4f 70 65 6e 52 67 6e 3b | 0d 09 09 0d 09 09 46 72 |OpenRgn;|......Fr|
|00002e10| 61 6d 65 52 65 63 74 28 | 65 78 74 65 6e 74 29 3b |ameRect(|extent);|
|00002e20| 0d 09 09 57 49 54 48 20 | 72 20 44 4f 20 42 45 47 |...WITH |r DO BEG|
|00002e30| 49 4e 0d 09 09 09 74 6f | 70 20 3a 3d 20 74 6f 70 |IN....to|p := top|
|00002e40| 20 2b 20 28 28 62 6f 74 | 74 6f 6d 20 2d 20 74 6f | + ((bot|tom - to|
|00002e50| 70 29 20 44 49 56 20 33 | 29 3b 0d 09 09 09 62 6f |p) DIV 3|);....bo|
|00002e60| 74 74 6f 6d 20 3a 3d 20 | 74 6f 70 20 2b 20 28 28 |ttom := |top + ((|
|00002e70| 62 6f 74 74 6f 6d 20 2d | 20 74 6f 70 29 20 44 49 |bottom -| top) DI|
|00002e80| 56 20 32 29 3b 0d 09 09 | 45 4e 44 3b 0d 09 09 46 |V 2);...|END;...F|
|00002e90| 72 61 6d 65 4f 76 61 6c | 28 72 29 3b 0d 09 09 70 |rameOval|(r);...p|
|00002ea0| 48 61 6e 64 6c 65 20 3a | 3d 20 4f 70 65 6e 50 6f |Handle :|= OpenPo|
|00002eb0| 6c 79 3b 0d 09 09 57 49 | 54 48 20 65 78 74 65 6e |ly;...WI|TH exten|
|00002ec0| 74 20 44 4f 20 42 45 47 | 49 4e 0d 09 09 09 4d 6f |t DO BEG|IN....Mo|
|00002ed0| 76 65 54 6f 28 6c 65 66 | 74 2c 20 74 6f 70 29 3b |veTo(lef|t, top);|
|00002ee0| 0d 09 09 09 4c 69 6e 65 | 54 6f 28 72 69 67 68 74 |....Line|To(right|
|00002ef0| 2c 20 62 6f 74 74 6f 6d | 29 3b 0d 09 09 09 4c 69 |, bottom|);....Li|
|00002f00| 6e 65 54 6f 28 6c 65 66 | 74 20 2b 20 28 72 69 67 |neTo(lef|t + (rig|
|00002f10| 68 74 20 2d 20 6c 65 66 | 74 29 20 44 49 56 20 32 |ht - lef|t) DIV 2|
|00002f20| 2c 20 62 6f 74 74 6f 6d | 20 2d 20 28 62 6f 74 74 |, bottom| - (bott|
|00002f30| 6f 6d 20 2d 20 74 6f 70 | 29 20 44 49 56 20 33 29 |om - top|) DIV 3)|
|00002f40| 3b 0d 09 09 09 4c 69 6e | 65 54 6f 28 6c 65 66 74 |;....Lin|eTo(left|
|00002f50| 2c 20 74 6f 70 29 3b 0d | 09 09 45 4e 44 3b 0d 09 |, top);.|..END;..|
|00002f60| 09 43 6c 6f 73 65 50 6f | 6c 79 3b 0d 09 09 46 72 |.ClosePo|ly;...Fr|
|00002f70| 61 6d 65 50 6f 6c 79 28 | 70 48 61 6e 64 6c 65 29 |amePoly(|pHandle)|
|00002f80| 3b 0d 09 09 4b 69 6c 6c | 50 6f 6c 79 28 70 48 61 |;...Kill|Poly(pHa|
|00002f90| 6e 64 6c 65 29 3b 0d 09 | 09 0d 09 09 43 6c 6f 73 |ndle);..|....Clos|
|00002fa0| 65 52 67 6e 28 72 48 61 | 6e 64 6c 65 29 3b 0d 09 |eRgn(rHa|ndle);..|
|00002fb0| 09 65 78 74 65 6e 74 20 | 3a 3d 20 72 48 61 6e 64 |.extent |:= rHand|
|00002fc0| 6c 65 5e 5e 2e 72 67 6e | 42 42 6f 78 3b 09 09 7b |le^^.rgn|BBox;..{|
|00002fd0| 69 6e 20 63 61 73 65 20 | 62 69 67 67 65 72 20 74 |in case |bigger t|
|00002fe0| 68 61 6e 20 6f 72 69 67 | 69 6e 61 6c 20 72 65 63 |han orig|inal rec|
|00002ff0| 74 7d 0d 09 09 49 46 20 | 67 4d 61 63 2e 68 61 73 |t}...IF |gMac.has|
|00003000| 43 6f 6c 6f 72 51 44 20 | 54 48 45 4e 0d 09 09 09 |ColorQD |THEN....|
|00003010| 50 61 69 6e 74 52 67 6e | 28 72 48 61 6e 64 6c 65 |PaintRgn|(rHandle|
|00003020| 29 0d 09 09 45 4c 53 45 | 0d 09 09 09 46 69 6c 6c |)...ELSE|....Fill|
|00003030| 52 67 6e 28 72 48 61 6e | 64 6c 65 2c 20 62 6c 61 |Rgn(rHan|dle, bla|
|00003040| 63 6b 29 3b 0d 09 09 46 | 6f 72 65 43 6f 6c 6f 72 |ck);...F|oreColor|
|00003050| 28 62 6c 61 63 6b 43 6f | 6c 6f 72 29 3b 0d 09 09 |(blackCo|lor);...|
|00003060| 46 72 61 6d 65 52 67 6e | 28 72 48 61 6e 64 6c 65 |FrameRgn|(rHandle|
|00003070| 29 3b 0d 09 09 44 69 73 | 70 6f 73 65 52 67 6e 28 |);...Dis|poseRgn(|
|00003080| 72 48 61 6e 64 6c 65 29 | 3b 0d 09 45 4e 44 3b 20 |rHandle)|;..END; |
|00003090| 7b 44 6f 52 65 67 69 6f | 6e 7d 0d 09 0d 09 50 52 |{DoRegio|n}....PR|
|000030a0| 4f 43 45 44 55 52 45 20 | 44 6f 50 6f 6c 79 3b 0d |OCEDURE |DoPoly;.|
|000030b0| 09 0d 09 7b 47 65 6e 65 | 72 61 74 65 20 61 20 70 |...{Gene|rate a p|
|000030c0| 6f 6c 79 67 6f 6e 20 62 | 61 73 65 64 20 6f 6e 20 |olygon b|ased on |
|000030d0| 74 68 65 20 65 78 74 65 | 6e 74 2e 7d 0d 09 0d 09 |the exte|nt.}....|
|000030e0| 56 41 52 0d 09 09 70 48 | 61 6e 64 6c 65 09 3a 20 |VAR...pH|andle.: |
|000030f0| 50 6f 6c 79 48 61 6e 64 | 6c 65 3b 0d 09 09 0d 09 |PolyHand|le;.....|
|00003100| 42 45 47 49 4e 0d 09 09 | 70 48 61 6e 64 6c 65 20 |BEGIN...|pHandle |
|00003110| 3a 3d 20 4f 70 65 6e 50 | 6f 6c 79 3b 0d 09 09 57 |:= OpenP|oly;...W|
|00003120| 49 54 48 20 65 78 74 65 | 6e 74 20 44 4f 20 42 45 |ITH exte|nt DO BE|
|00003130| 47 49 4e 0d 09 09 09 4d | 6f 76 65 54 6f 28 6c 65 |GIN....M|oveTo(le|
|00003140| 66 74 20 2b 20 28 72 69 | 67 68 74 20 2d 20 6c 65 |ft + (ri|ght - le|
|00003150| 66 74 29 20 44 49 56 20 | 32 2c 20 74 6f 70 29 3b |ft) DIV |2, top);|
|00003160| 0d 09 09 09 4c 69 6e 65 | 54 6f 28 72 69 67 68 74 |....Line|To(right|
|00003170| 2c 20 62 6f 74 74 6f 6d | 29 3b 0d 09 09 09 4c 69 |, bottom|);....Li|
|00003180| 6e 65 54 6f 28 6c 65 66 | 74 2c 20 74 6f 70 20 2b |neTo(lef|t, top +|
|00003190| 20 28 62 6f 74 74 6f 6d | 20 2d 20 74 6f 70 29 20 | (bottom| - top) |
|000031a0| 44 49 56 20 33 29 3b 0d | 09 09 09 4c 69 6e 65 54 |DIV 3);.|...LineT|
|000031b0| 6f 28 72 69 67 68 74 2c | 20 74 6f 70 20 2b 20 28 |o(right,| top + (|
|000031c0| 62 6f 74 74 6f 6d 20 2d | 20 74 6f 70 29 20 44 49 |bottom -| top) DI|
|000031d0| 56 20 33 29 3b 0d 09 09 | 09 4c 69 6e 65 54 6f 28 |V 3);...|.LineTo(|
|000031e0| 6c 65 66 74 2c 20 62 6f | 74 74 6f 6d 29 3b 0d 09 |left, bo|ttom);..|
|000031f0| 09 09 4c 69 6e 65 54 6f | 28 6c 65 66 74 20 2b 20 |..LineTo|(left + |
|00003200| 28 72 69 67 68 74 20 2d | 20 6c 65 66 74 29 20 44 |(right -| left) D|
|00003210| 49 56 20 32 2c 20 74 6f | 70 29 3b 0d 09 09 45 4e |IV 2, to|p);...EN|
|00003220| 44 3b 0d 09 09 43 6c 6f | 73 65 50 6f 6c 79 3b 0d |D;...Clo|sePoly;.|
|00003230| 09 09 65 78 74 65 6e 74 | 20 3a 3d 20 70 48 61 6e |..extent| := pHan|
|00003240| 64 6c 65 5e 5e 2e 70 6f | 6c 79 42 42 6f 78 3b 09 |dle^^.po|lyBBox;.|
|00003250| 09 7b 69 6e 20 63 61 73 | 65 20 62 69 67 67 65 72 |.{in cas|e bigger|
|00003260| 20 74 68 61 6e 20 6f 72 | 69 67 69 6e 61 6c 20 72 | than or|iginal r|
|00003270| 65 63 74 7d 0d 09 09 49 | 46 20 67 4d 61 63 2e 68 |ect}...I|F gMac.h|
|00003280| 61 73 43 6f 6c 6f 72 51 | 44 20 54 48 45 4e 0d 09 |asColorQ|D THEN..|
|00003290| 09 09 50 61 69 6e 74 50 | 6f 6c 79 28 70 48 61 6e |..PaintP|oly(pHan|
|000032a0| 64 6c 65 29 0d 09 09 45 | 4c 53 45 0d 09 09 09 46 |dle)...E|LSE....F|
|000032b0| 69 6c 6c 50 6f 6c 79 28 | 70 48 61 6e 64 6c 65 2c |illPoly(|pHandle,|
|000032c0| 20 6c 74 47 72 61 79 29 | 3b 0d 09 09 46 6f 72 65 | ltGray)|;...Fore|
|000032d0| 43 6f 6c 6f 72 28 62 6c | 61 63 6b 43 6f 6c 6f 72 |Color(bl|ackColor|
|000032e0| 29 3b 0d 09 09 46 72 61 | 6d 65 50 6f 6c 79 28 70 |);...Fra|mePoly(p|
|000032f0| 48 61 6e 64 6c 65 29 3b | 0d 09 09 4b 69 6c 6c 50 |Handle);|...KillP|
|00003300| 6f 6c 79 28 70 48 61 6e | 64 6c 65 29 3b 0d 09 45 |oly(pHan|dle);..E|
|00003310| 4e 44 3b 20 7b 44 6f 50 | 6f 6c 79 7d 0d 09 0d 42 |ND; {DoP|oly}...B|
|00003320| 45 47 49 4e 0d 09 50 65 | 6e 4e 6f 72 6d 61 6c 3b |EGIN..Pe|nNormal;|
|00003330| 0d 09 50 65 6e 53 69 7a | 65 28 6b 46 72 61 6d 65 |..PenSiz|e(kFrame|
|00003340| 50 65 6e 48 2c 20 6b 46 | 72 61 6d 65 50 65 6e 56 |PenH, kF|ramePenV|
|00003350| 29 3b 0d 09 43 41 53 45 | 20 73 68 61 70 65 20 4f |);..CASE| shape O|
|00003360| 46 0d 09 09 6b 4f 76 61 | 6c 3a 20 42 45 47 49 4e |F...kOva|l: BEGIN|
|00003370| 0d 09 09 09 49 46 20 67 | 4d 61 63 2e 68 61 73 43 |....IF g|Mac.hasC|
|00003380| 6f 6c 6f 72 51 44 20 54 | 48 45 4e 0d 09 09 09 09 |olorQD T|HEN.....|
|00003390| 50 61 69 6e 74 4f 76 61 | 6c 28 65 78 74 65 6e 74 |PaintOva|l(extent|
|000033a0| 29 0d 09 09 09 45 4c 53 | 45 0d 09 09 09 09 46 69 |)....ELS|E.....Fi|
|000033b0| 6c 6c 4f 76 61 6c 28 65 | 78 74 65 6e 74 2c 20 77 |llOval(e|xtent, w|
|000033c0| 68 69 74 65 29 3b 0d 09 | 09 09 46 6f 72 65 43 6f |hite);..|..ForeCo|
|000033d0| 6c 6f 72 28 62 6c 61 63 | 6b 43 6f 6c 6f 72 29 3b |lor(blac|kColor);|
|000033e0| 0d 09 09 09 46 72 61 6d | 65 4f 76 61 6c 28 65 78 |....Fram|eOval(ex|
|000033f0| 74 65 6e 74 29 3b 0d 09 | 09 45 4e 44 3b 0d 09 09 |tent);..|.END;...|
|00003400| 6b 52 65 67 69 6f 6e 3a | 0d 09 09 09 44 6f 52 65 |kRegion:|....DoRe|
|00003410| 67 69 6f 6e 3b 0d 09 09 | 6b 52 52 65 63 74 3a 20 |gion;...|kRRect: |
|00003420| 42 45 47 49 4e 0d 09 09 | 09 49 46 20 67 4d 61 63 |BEGIN...|.IF gMac|
|00003430| 2e 68 61 73 43 6f 6c 6f | 72 51 44 20 54 48 45 4e |.hasColo|rQD THEN|
|00003440| 0d 09 09 09 09 50 61 69 | 6e 74 52 6f 75 6e 64 52 |.....Pai|ntRoundR|
|00003450| 65 63 74 28 65 78 74 65 | 6e 74 2c 20 31 36 2c 20 |ect(exte|nt, 16, |
|00003460| 31 36 29 0d 09 09 09 45 | 4c 53 45 0d 09 09 09 09 |16)....E|LSE.....|
|00003470| 46 69 6c 6c 52 6f 75 6e | 64 52 65 63 74 28 65 78 |FillRoun|dRect(ex|
|00003480| 74 65 6e 74 2c 20 31 36 | 2c 20 31 36 2c 20 67 72 |tent, 16|, 16, gr|
|00003490| 61 79 29 3b 0d 09 09 09 | 46 6f 72 65 43 6f 6c 6f |ay);....|ForeColo|
|000034a0| 72 28 62 6c 61 63 6b 43 | 6f 6c 6f 72 29 3b 0d 09 |r(blackC|olor);..|
|000034b0| 09 09 46 72 61 6d 65 52 | 6f 75 6e 64 52 65 63 74 |..FrameR|oundRect|
|000034c0| 28 65 78 74 65 6e 74 2c | 20 31 36 2c 20 31 36 29 |(extent,| 16, 16)|
|000034d0| 3b 0d 09 09 45 4e 44 3b | 0d 09 09 6b 50 6f 6c 79 |;...END;|...kPoly|
|000034e0| 3a 0d 09 09 09 44 6f 50 | 6f 6c 79 3b 0d 09 09 6b |:....DoP|oly;...k|
|000034f0| 52 65 63 74 3a 20 42 45 | 47 49 4e 0d 09 09 09 49 |Rect: BE|GIN....I|
|00003500| 46 20 67 4d 61 63 2e 68 | 61 73 43 6f 6c 6f 72 51 |F gMac.h|asColorQ|
|00003510| 44 20 54 48 45 4e 0d 09 | 09 09 09 50 61 69 6e 74 |D THEN..|...Paint|
|00003520| 52 65 63 74 28 65 78 74 | 65 6e 74 29 0d 09 09 09 |Rect(ext|ent)....|
|00003530| 45 4c 53 45 0d 09 09 09 | 09 46 69 6c 6c 52 65 63 |ELSE....|.FillRec|
|00003540| 74 28 65 78 74 65 6e 74 | 2c 20 64 6b 47 72 61 79 |t(extent|, dkGray|
|00003550| 29 3b 0d 09 09 09 46 6f | 72 65 43 6f 6c 6f 72 28 |);....Fo|reColor(|
|00003560| 62 6c 61 63 6b 43 6f 6c | 6f 72 29 3b 0d 09 09 09 |blackCol|or);....|
|00003570| 46 72 61 6d 65 52 65 63 | 74 28 65 78 74 65 6e 74 |FrameRec|t(extent|
|00003580| 29 3b 0d 09 09 45 4e 44 | 3b 0d 09 09 6b 49 43 4f |);...END|;...kICO|
|00003590| 4e 3a 0d 09 09 09 49 46 | 20 67 4d 61 63 2e 68 61 |N:....IF| gMac.ha|
|000035a0| 73 43 6f 6c 6f 72 51 44 | 20 54 48 45 4e 0d 09 09 |sColorQD| THEN...|
|000035b0| 09 09 50 6c 6f 74 43 49 | 63 6f 6e 28 65 78 74 65 |..PlotCI|con(exte|
|000035c0| 6e 74 2c 20 67 63 69 63 | 6e 29 0d 09 09 09 45 4c |nt, gcic|n)....EL|
|000035d0| 53 45 20 42 45 47 49 4e | 20 0d 09 09 09 09 48 4c |SE BEGIN| .....HL|
|000035e0| 6f 63 6b 28 48 61 6e 64 | 6c 65 28 67 63 69 63 6e |ock(Hand|le(gcicn|
|000035f0| 29 29 3b 0d 09 09 09 09 | 57 49 54 48 20 67 63 69 |));.....|WITH gci|
|00003600| 63 6e 5e 5e 20 44 4f 20 | 42 45 47 49 4e 0d 09 09 |cn^^ DO |BEGIN...|
|00003610| 09 09 7b 57 65 20 63 61 | 6e 6e 6f 74 20 63 61 6c |..{We ca|nnot cal|
|00003620| 6c 20 50 6c 6f 74 43 49 | 63 6f 6e 20 77 68 65 6e |l PlotCI|con when|
|00003630| 20 43 6f 6c 6f 72 20 51 | 44 20 69 73 20 6e 6f 74 | Color Q|D is not|
|00003640| 0d 09 09 09 09 20 70 72 | 65 73 65 6e 74 2c 20 62 |..... pr|esent, b|
|00003650| 75 74 20 77 65 20 63 61 | 6e 20 73 74 69 6c 6c 20 |ut we ca|n still |
|00003660| 75 73 65 20 74 68 65 20 | 63 6f 6c 6f 72 20 69 63 |use the |color ic|
|00003670| 6f 6e 0d 09 09 09 09 20 | 64 61 74 61 2e 7d 0d 09 |on..... |data.}..|
|00003680| 09 09 09 09 69 63 6f 6e | 4d 61 73 6b 2e 62 61 73 |....icon|Mask.bas|
|00003690| 65 41 64 64 72 20 3a 3d | 20 40 69 63 6f 6e 4d 61 |eAddr :=| @iconMa|
|000036a0| 73 6b 44 61 74 61 3b 0d | 09 09 09 09 09 69 63 6f |skData;.|.....ico|
|000036b0| 6e 42 4d 61 70 2e 62 61 | 73 65 41 64 64 72 20 3a |nBMap.ba|seAddr :|
|000036c0| 3d 20 50 74 72 28 4f 52 | 44 28 40 69 63 6f 6e 4d |= Ptr(OR|D(@iconM|
|000036d0| 61 73 6b 44 61 74 61 29 | 20 2b 20 31 32 38 29 3b |askData)| + 128);|
|000036e0| 0d 09 09 09 09 09 43 6f | 70 79 4d 61 73 6b 28 69 |......Co|pyMask(i|
|000036f0| 63 6f 6e 42 4d 61 70 2c | 20 69 63 6f 6e 4d 61 73 |conBMap,| iconMas|
|00003700| 6b 2c 20 74 68 65 50 6f | 72 74 5e 2e 70 6f 72 74 |k, thePo|rt^.port|
|00003710| 42 69 74 73 2c 0d 09 09 | 09 09 09 09 09 09 69 63 |Bits,...|......ic|
|00003720| 6f 6e 42 4d 61 70 2e 62 | 6f 75 6e 64 73 2c 20 69 |onBMap.b|ounds, i|
|00003730| 63 6f 6e 4d 61 73 6b 2e | 62 6f 75 6e 64 73 2c 20 |conMask.|bounds, |
|00003740| 65 78 74 65 6e 74 29 3b | 0d 09 09 09 09 45 4e 44 |extent);|.....END|
|00003750| 3b 0d 09 09 09 09 48 55 | 6e 6c 6f 63 6b 28 48 61 |;.....HU|nlock(Ha|
|00003760| 6e 64 6c 65 28 67 63 69 | 63 6e 29 29 3b 0d 09 09 |ndle(gci|cn));...|
|00003770| 09 45 4e 44 3b 0d 09 09 | 6b 50 49 43 54 3a 0d 09 |.END;...|kPICT:..|
|00003780| 09 09 44 72 61 77 50 69 | 63 74 75 72 65 28 67 50 |..DrawPi|cture(gP|
|00003790| 49 43 54 2c 20 65 78 74 | 65 6e 74 29 3b 0d 09 45 |ICT, ext|ent);..E|
|000037a0| 4e 44 3b 0d 45 4e 44 3b | 20 7b 44 72 61 77 53 68 |ND;.END;| {DrawSh|
|000037b0| 61 70 65 7d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |ape}...{|$S Main}|
|000037c0| 0d 46 55 4e 43 54 49 4f | 4e 20 47 69 6d 6d 65 42 |.FUNCTIO|N GimmeB|
|000037d0| 6c 61 63 6b 41 6e 64 57 | 68 69 74 65 28 72 67 62 |lackAndW|hite(rgb|
|000037e0| 3a 20 52 47 42 43 6f 6c | 6f 72 3b 20 56 41 52 20 |: RGBCol|or; VAR |
|000037f0| 70 6f 73 69 74 69 6f 6e | 3a 20 4c 4f 4e 47 49 4e |position|: LONGIN|
|00003800| 54 29 3a 20 42 4f 4f 4c | 45 41 4e 3b 0d 0d 7b 54 |T): BOOL|EAN;..{T|
|00003810| 68 69 73 20 69 73 20 61 | 20 73 65 61 72 63 68 20 |his is a| search |
|00003820| 70 72 6f 63 20 74 68 61 | 74 20 72 65 74 75 72 6e |proc tha|t return|
|00003830| 73 20 77 68 69 74 65 20 | 6f 6e 6c 79 20 69 66 20 |s white |only if |
|00003840| 74 68 65 20 63 6f 6c 6f | 72 20 69 73 20 72 65 61 |the colo|r is rea|
|00003850| 6c 6c 79 20 77 68 69 74 | 65 3b 0d 20 6f 74 68 65 |lly whit|e;. othe|
|00003860| 72 77 69 73 65 20 69 74 | 20 72 65 74 75 72 6e 73 |rwise it| returns|
|00003870| 20 62 6c 61 63 6b 2e 20 | 49 74 20 69 73 20 75 73 | black. |It is us|
|00003880| 65 64 20 74 6f 20 67 65 | 6e 65 72 61 74 65 20 74 |ed to ge|nerate t|
|00003890| 68 65 20 6d 61 73 6b 20 | 66 6f 72 20 74 68 65 20 |he mask |for the |
|000038a0| 63 6f 6c 6f 72 0d 20 63 | 75 72 73 6f 72 2e 20 49 |color. c|ursor. I|
|000038b0| 74 20 62 6f 6c 64 6c 79 | 20 61 73 73 75 6d 65 73 |t boldly| assumes|
|000038c0| 20 74 68 61 74 20 69 74 | 20 69 73 20 62 65 69 6e | that it| is bein|
|000038d0| 67 20 63 61 6c 6c 65 64 | 20 66 6f 72 20 61 20 31 |g called| for a 1|
|000038e0| 20 62 69 74 20 64 65 65 | 70 20 6d 61 70 2e 7d 0d | bit dee|p map.}.|
|000038f0| 0d 42 45 47 49 4e 0d 09 | 57 49 54 48 20 72 67 62 |.BEGIN..|WITH rgb|
|00003900| 20 44 4f 0d 09 09 49 46 | 20 28 72 65 64 20 3d 20 | DO...IF| (red = |
|00003910| 24 46 46 46 46 29 20 26 | 20 28 67 72 65 65 6e 20 |$FFFF) &| (green |
|00003920| 3d 20 24 46 46 46 46 29 | 20 26 20 28 62 6c 75 65 |= $FFFF)| & (blue|
|00003930| 20 3d 20 24 46 46 46 46 | 29 20 54 48 45 4e 0d 09 | = $FFFF|) THEN..|
|00003940| 09 09 70 6f 73 69 74 69 | 6f 6e 20 3a 3d 20 30 09 |..positi|on := 0.|
|00003950| 09 09 09 09 7b 72 65 74 | 75 72 6e 20 77 68 69 74 |....{ret|urn whit|
|00003960| 65 20 69 66 20 69 74 d5 | 73 20 77 68 69 74 65 7d |e if it.|s white}|
|00003970| 0d 09 09 45 4c 53 45 0d | 09 09 09 70 6f 73 69 74 |...ELSE.|...posit|
|00003980| 69 6f 6e 20 3a 3d 20 31 | 3b 09 09 09 09 09 7b 65 |ion := 1|;.....{e|
|00003990| 6c 73 65 20 72 65 74 75 | 72 6e 20 62 6c 61 63 6b |lse retu|rn black|
|000039a0| 20 66 6f 72 20 61 6c 6c | 20 6f 74 68 65 72 20 63 | for all| other c|
|000039b0| 6f 6c 6f 72 73 7d 0d 09 | 47 69 6d 6d 65 42 6c 61 |olors}..|GimmeBla|
|000039c0| 63 6b 41 6e 64 57 68 69 | 74 65 20 3a 3d 20 54 52 |ckAndWhi|te := TR|
|000039d0| 55 45 3b 0d 45 4e 44 3b | 20 7b 47 69 6d 6d 65 42 |UE;.END;| {GimmeB|
|000039e0| 6c 61 63 6b 41 6e 64 57 | 68 69 74 65 7d 0d 0d 0d |lackAndW|hite}...|
|000039f0| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00003a00| 55 52 45 20 53 65 74 4f | 62 6a 43 75 72 73 6f 72 |URE SetO|bjCursor|
|00003a10| 20 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 | (window|: Window|
|00003a20| 50 74 72 29 3b 0d 0d 7b | 42 75 69 6c 64 20 74 68 |Ptr);..{|Build th|
|00003a30| 65 20 63 6f 6c 6f 72 20 | 63 75 72 73 6f 72 2e 20 |e color |cursor. |
|00003a40| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 69 73 20 72 |Note tha|t this r|
|00003a50| 6f 75 74 69 6e 65 20 69 | 73 20 6f 6e 6c 79 20 63 |outine i|s only c|
|00003a60| 61 6c 6c 65 64 0d 20 69 | 6e 20 61 20 43 6f 6c 6f |alled. i|n a Colo|
|00003a70| 72 20 51 44 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |r QD env|ironment|
|00003a80| 2c 20 73 6f 20 69 74 20 | 64 6f 65 73 6e 27 74 20 |, so it |doesn't |
|00003a90| 68 61 76 65 20 74 6f 20 | 6d 61 6b 65 20 74 68 65 |have to |make the|
|00003aa0| 0d 20 63 68 65 63 6b 2e | 20 4e 6f 74 65 20 61 6c |. check.| Note al|
|00003ab0| 73 6f 20 74 68 61 74 20 | 74 68 65 20 63 75 72 73 |so that |the curs|
|00003ac0| 6f 72 73 20 63 6f 75 6c | 64 20 68 61 76 65 20 61 |ors coul|d have a|
|00003ad0| 6c 6c 20 62 65 65 6e 20 | 27 70 72 65 2d 0d 20 62 |ll been |'pre-. b|
|00003ae0| 75 69 6c 74 27 2c 20 74 | 68 75 73 20 6d 61 6b 69 |uilt', t|hus maki|
|00003af0| 6e 67 20 74 68 69 6e 67 | 73 20 6d 6f 72 65 20 65 |ng thing|s more e|
|00003b00| 66 66 69 63 69 65 6e 74 | 2c 20 62 75 74 20 74 68 |fficient|, but th|
|00003b10| 69 73 20 65 78 61 6d 70 | 6c 65 0d 20 73 68 6f 77 |is examp|le. show|
|00003b20| 73 20 74 68 61 74 20 64 | 79 6e 61 6d 69 63 20 63 |s that d|ynamic c|
|00003b30| 75 72 73 6f 72 73 20 63 | 61 6e 20 62 65 20 69 6d |ursors c|an be im|
|00003b40| 70 6c 65 6d 65 6e 74 65 | 64 20 76 69 61 20 70 69 |plemente|d via pi|
|00003b50| 78 6d 61 70 73 2e 7d 0d | 0d 56 41 52 0d 09 63 6f |xmaps.}.|.VAR..co|
|00003b60| 6c 6f 72 73 09 09 09 3a | 20 43 54 61 62 48 61 6e |lors...:| CTabHan|
|00003b70| 64 6c 65 3b 0d 09 70 61 | 6c 09 09 09 09 3a 20 50 |dle;..pa|l....: P|
|00003b80| 61 6c 65 74 74 65 48 61 | 6e 64 6c 65 3b 0d 09 72 |aletteHa|ndle;..r|
|00003b90| 67 62 09 09 09 09 3a 20 | 52 47 42 43 6f 6c 6f 72 |gb....: |RGBColor|
|00003ba0| 3b 0d 09 62 6f 75 6e 64 | 65 72 2c 20 65 78 74 65 |;..bound|er, exte|
|00003bb0| 6e 74 09 3a 20 52 65 63 | 74 3b 0d 09 62 75 66 66 |nt.: Rec|t;..buff|
|00003bc0| 4e 6f 74 4e 65 65 64 65 | 64 09 3a 20 42 4f 4f 4c |NotNeede|d.: BOOL|
|00003bd0| 45 41 4e 3b 0d 09 6e 61 | 75 67 68 74 79 42 69 74 |EAN;..na|ughtyBit|
|00003be0| 73 09 09 3a 20 42 69 74 | 4d 61 70 3b 0d 09 6f 6e |s..: Bit|Map;..on|
|00003bf0| 65 42 69 74 50 4d 61 70 | 09 09 3a 20 42 69 74 4d |eBitPMap|..: BitM|
|00003c00| 61 70 50 74 72 3b 0d 0d | 42 45 47 49 4e 0d 09 53 |apPtr;..|BEGIN..S|
|00003c10| 65 74 52 65 63 74 28 62 | 6f 75 6e 64 65 72 2c 20 |etRect(b|ounder, |
|00003c20| 30 2c 20 30 2c 20 31 36 | 2c 20 31 36 29 3b 0d 09 |0, 0, 16|, 16);..|
|00003c30| 70 61 6c 20 3a 3d 20 47 | 65 74 50 61 6c 65 74 74 |pal := G|etPalett|
|00003c40| 65 28 77 69 6e 64 6f 77 | 29 3b 0d 09 47 65 74 45 |e(window|);..GetE|
|00003c50| 6e 74 72 79 43 6f 6c 6f | 72 28 70 61 6c 2c 20 4f |ntryColo|r(pal, O|
|00003c60| 52 44 28 67 53 68 61 70 | 65 29 20 2b 20 32 2c 20 |RD(gShap|e) + 2, |
|00003c70| 72 67 62 29 3b 09 7b 67 | 65 74 20 74 68 65 20 63 |rgb);.{g|et the c|
|00003c80| 6f 6c 6f 72 20 75 73 65 | 64 20 66 6f 72 20 74 68 |olor use|d for th|
|00003c90| 65 20 73 68 61 70 65 7d | 0d 09 0d 09 44 69 73 70 |e shape}|....Disp|
|00003ca0| 6f 73 65 4f 66 66 73 63 | 72 65 65 6e 28 67 4f 75 |oseOffsc|reen(gOu|
|00003cb0| 67 68 48 61 6e 64 6c 65 | 29 3b 09 09 09 09 7b 67 |ghHandle|);....{g|
|00003cc0| 65 74 20 72 69 64 20 6f | 66 20 6f 6c 64 20 63 6f |et rid o|f old co|
|00003cd0| 6c 6f 72 20 74 61 62 6c | 65 7d 0d 09 63 6f 6c 6f |lor tabl|e}..colo|
|00003ce0| 72 73 20 3a 3d 20 43 54 | 61 62 48 61 6e 64 6c 65 |rs := CT|abHandle|
|00003cf0| 28 4e 65 77 48 61 6e 64 | 6c 65 43 6c 65 61 72 28 |(NewHand|leClear(|
|00003d00| 53 49 5a 45 4f 46 28 43 | 6f 6c 6f 72 54 61 62 6c |SIZEOF(C|olorTabl|
|00003d10| 65 29 29 29 3b 0d 09 46 | 61 69 6c 4e 49 4c 4d 73 |e)));..F|ailNILMs|
|00003d20| 67 28 63 6f 6c 6f 72 73 | 2c 20 65 4e 6f 4d 65 6d |g(colors|, eNoMem|
|00003d30| 6f 72 79 29 3b 0d 09 63 | 6f 6c 6f 72 73 5e 5e 2e |ory);..c|olors^^.|
|00003d40| 63 74 54 61 62 6c 65 5b | 30 5d 2e 72 67 62 20 3a |ctTable[|0].rgb :|
|00003d50| 3d 20 72 67 62 3b 09 09 | 09 09 7b 73 74 75 66 66 |= rgb;..|..{stuff|
|00003d60| 20 69 6e 20 74 68 65 20 | 63 6f 6c 6f 72 20 77 65 | in the |color we|
|00003d70| 20 77 61 6e 74 7d 0d 09 | 0d 09 46 61 69 6c 4f 53 | want}..|..FailOS|
|00003d80| 45 72 72 28 4e 65 77 4f | 66 66 73 63 72 65 65 6e |Err(NewO|ffscreen|
|00003d90| 28 62 6f 75 6e 64 65 72 | 2c 20 6b 43 75 72 73 6f |(bounder|, kCurso|
|00003da0| 72 44 65 70 74 68 2c 20 | 63 6f 6c 6f 72 73 2c 0d |rDepth, |colors,.|
|00003db0| 09 09 09 09 09 4e 4f 54 | 20 6b 4d 65 6d 6f 72 79 |.....NOT| kMemory|
|00003dc0| 50 6f 6c 69 74 65 2c 20 | 62 75 66 66 4e 6f 74 4e |Polite, |buffNotN|
|00003dd0| 65 65 64 65 64 2c 0d 09 | 09 09 09 09 67 4f 75 67 |eeded,..|....gOug|
|00003de0| 68 48 61 6e 64 6c 65 29 | 29 3b 0d 09 44 69 73 70 |hHandle)|);..Disp|
|00003df0| 6f 73 48 61 6e 64 6c 65 | 28 48 61 6e 64 6c 65 28 |osHandle|(Handle(|
|00003e00| 63 6f 6c 6f 72 73 29 29 | 3b 0d 09 0d 09 48 4c 6f |colors))|;....HLo|
|00003e10| 63 6b 28 48 61 6e 64 6c | 65 28 67 43 75 72 73 6f |ck(Handl|e(gCurso|
|00003e20| 72 29 29 3b 0d 09 57 49 | 54 48 20 67 43 75 72 73 |r));..WI|TH gCurs|
|00003e30| 6f 72 5e 5e 20 44 4f 20 | 42 45 47 49 4e 0d 09 09 |or^^ DO |BEGIN...|
|00003e40| 63 72 73 72 4d 61 70 20 | 3a 3d 20 50 69 78 4d 61 |crsrMap |:= PixMa|
|00003e50| 70 48 61 6e 64 6c 65 28 | 52 65 63 6f 76 65 72 48 |pHandle(|RecoverH|
|00003e60| 61 6e 64 6c 65 28 50 74 | 72 28 47 65 74 4d 61 70 |andle(Pt|r(GetMap|
|00003e70| 28 67 4f 75 67 68 48 61 | 6e 64 6c 65 29 29 29 29 |(gOughHa|ndle))))|
|00003e80| 3b 0d 09 09 63 72 73 72 | 44 61 74 61 20 3a 3d 20 |;...crsr|Data := |
|00003e90| 47 65 74 42 69 74 73 48 | 61 6e 64 6c 65 28 67 4f |GetBitsH|andle(gO|
|00003ea0| 75 67 68 48 61 6e 64 6c | 65 29 3b 0d 09 09 49 46 |ughHandl|e);...IF|
|00003eb0| 20 63 72 73 72 44 61 74 | 61 20 3d 20 4e 49 4c 20 | crsrDat|a = NIL |
|00003ec0| 54 48 45 4e 20 42 45 47 | 49 4e 09 09 09 7b 6e 6f |THEN BEG|IN...{no|
|00003ed0| 20 68 61 6e 64 6c 65 20 | 74 6f 20 62 69 74 73 20 | handle |to bits |
|00003ee0| 61 76 61 69 6c 61 62 6c | 65 2d 70 75 6e 74 7d 0d |availabl|e-punt}.|
|00003ef0| 09 09 09 53 65 74 43 75 | 72 73 6f 72 28 61 72 72 |...SetCu|rsor(arr|
|00003f00| 6f 77 29 3b 0d 09 09 09 | 45 78 69 74 28 53 65 74 |ow);....|Exit(Set|
|00003f10| 4f 62 6a 43 75 72 73 6f | 72 29 3b 0d 09 09 45 4e |ObjCurso|r);...EN|
|00003f20| 44 3b 0d 09 09 42 65 67 | 69 6e 4f 66 66 73 63 72 |D;...Beg|inOffscr|
|00003f30| 65 65 6e 44 72 61 77 69 | 6e 67 28 67 4f 75 67 68 |eenDrawi|ng(gOugh|
|00003f40| 48 61 6e 64 6c 65 2c 20 | 4e 49 4c 29 3b 0d 09 09 |Handle, |NIL);...|
|00003f50| 49 46 20 4e 4f 54 20 28 | 67 53 68 61 70 65 20 49 |IF NOT (|gShape I|
|00003f60| 4e 20 5b 6b 49 43 4f 4e | 2c 20 6b 50 49 43 54 5d |N [kICON|, kPICT]|
|00003f70| 29 20 54 48 45 4e 20 42 | 45 47 49 4e 0d 09 09 09 |) THEN B|EGIN....|
|00003f80| 53 65 74 50 74 28 63 72 | 73 72 48 6f 74 53 70 6f |SetPt(cr|srHotSpo|
|00003f90| 74 2c 20 30 2c 20 30 29 | 3b 0d 09 09 09 52 47 42 |t, 0, 0)|;....RGB|
|00003fa0| 46 6f 72 65 43 6f 6c 6f | 72 28 72 67 62 29 3b 0d |ForeColo|r(rgb);.|
|00003fb0| 09 09 09 65 78 74 65 6e | 74 20 3a 3d 20 62 6f 75 |...exten|t := bou|
|00003fc0| 6e 64 65 72 3b 0d 09 09 | 09 49 6e 73 65 74 52 65 |nder;...|.InsetRe|
|00003fd0| 63 74 28 65 78 74 65 6e | 74 2c 20 33 2c 20 31 29 |ct(exten|t, 3, 1)|
|00003fe0| 3b 09 09 09 7b 73 71 75 | 65 65 7a 65 20 69 74 20 |;...{squ|eeze it |
|00003ff0| 61 20 62 69 74 7d 0d 09 | 09 09 44 72 61 77 53 68 |a bit}..|..DrawSh|
|00004000| 61 70 65 28 67 53 68 61 | 70 65 2c 20 65 78 74 65 |ape(gSha|pe, exte|
|00004010| 6e 74 29 3b 09 09 09 7b | 64 72 61 77 20 74 68 65 |nt);...{|draw the|
|00004020| 20 63 75 72 73 6f 72 20 | 73 68 61 70 65 7d 0d 09 | cursor |shape}..|
|00004030| 09 09 50 65 6e 4e 6f 72 | 6d 61 6c 3b 0d 09 09 09 |..PenNor|mal;....|
|00004040| 46 6f 72 65 43 6f 6c 6f | 72 28 62 6c 61 63 6b 43 |ForeColo|r(blackC|
|00004050| 6f 6c 6f 72 29 3b 09 09 | 09 09 7b 64 72 61 77 20 |olor);..|..{draw |
|00004060| 68 6f 74 20 73 70 6f 74 | 7d 0d 09 09 09 4d 6f 76 |hot spot|}....Mov|
|00004070| 65 54 6f 28 30 2c 20 30 | 29 3b 0d 09 09 09 4c 69 |eTo(0, 0|);....Li|
|00004080| 6e 65 54 6f 28 30 2c 20 | 31 29 3b 0d 09 09 45 4e |neTo(0, |1);...EN|
|00004090| 44 20 45 4c 53 45 20 42 | 45 47 49 4e 09 09 09 09 |D ELSE B|EGIN....|
|000040a0| 09 09 09 7b 75 73 65 20 | 61 20 70 6c 61 69 6e 20 |...{use |a plain |
|000040b0| 63 75 72 73 6f 72 20 66 | 6f 72 20 69 63 6f 6e 2f |cursor f|or icon/|
|000040c0| 70 69 63 74 7d 0d 09 09 | 09 53 65 74 50 74 28 63 |pict}...|.SetPt(c|
|000040d0| 72 73 72 48 6f 74 53 70 | 6f 74 2c 20 32 2c 20 32 |rsrHotSp|ot, 2, 2|
|000040e0| 29 3b 0d 09 09 09 50 65 | 6e 4e 6f 72 6d 61 6c 3b |);....Pe|nNormal;|
|000040f0| 0d 09 09 09 46 6f 72 65 | 43 6f 6c 6f 72 28 62 6c |....Fore|Color(bl|
|00004100| 61 63 6b 43 6f 6c 6f 72 | 29 3b 0d 09 09 09 4d 6f |ackColor|);....Mo|
|00004110| 76 65 54 6f 28 30 2c 20 | 30 29 3b 0d 09 09 09 4c |veTo(0, |0);....L|
|00004120| 69 6e 65 54 6f 28 34 2c | 20 34 29 3b 0d 09 09 09 |ineTo(4,| 4);....|
|00004130| 4d 6f 76 65 54 6f 28 34 | 2c 20 30 29 3b 0d 09 09 |MoveTo(4|, 0);...|
|00004140| 09 4c 69 6e 65 54 6f 28 | 30 2c 20 34 29 3b 0d 09 |.LineTo(|0, 4);..|
|00004150| 09 45 4e 44 3b 0d 09 09 | 45 6e 64 4f 66 66 73 63 |.END;...|EndOffsc|
|00004160| 72 65 65 6e 44 72 61 77 | 69 6e 67 28 67 4f 75 67 |reenDraw|ing(gOug|
|00004170| 68 48 61 6e 64 6c 65 29 | 3b 0d 09 09 57 49 54 48 |hHandle)|;...WITH|
|00004180| 20 6e 61 75 67 68 74 79 | 42 69 74 73 20 44 4f 20 | naughty|Bits DO |
|00004190| 42 45 47 49 4e 09 09 09 | 09 7b 62 75 69 6c 64 20 |BEGIN...|.{build |
|000041a0| 31 2d 62 69 74 20 69 6d | 61 67 65 20 61 6e 64 20 |1-bit im|age and |
|000041b0| 6d 61 73 6b 7d 0d 09 09 | 09 62 6f 75 6e 64 73 20 |mask}...|.bounds |
|000041c0| 3a 3d 20 62 6f 75 6e 64 | 65 72 3b 0d 09 09 09 62 |:= bound|er;....b|
|000041d0| 61 73 65 41 64 64 72 20 | 3a 3d 20 40 63 72 73 72 |aseAddr |:= @crsr|
|000041e0| 31 44 61 74 61 3b 0d 09 | 09 09 72 6f 77 42 79 74 |1Data;..|..rowByt|
|000041f0| 65 73 20 3a 3d 20 32 3b | 0d 09 09 09 43 6f 70 79 |es := 2;|....Copy|
|00004200| 42 69 74 73 28 42 69 74 | 4d 61 70 50 74 72 28 63 |Bits(Bit|MapPtr(c|
|00004210| 72 73 72 4d 61 70 5e 29 | 5e 2c 20 6e 61 75 67 68 |rsrMap^)|^, naugh|
|00004220| 74 79 42 69 74 73 2c 0d | 09 09 09 09 09 09 62 6f |tyBits,.|......bo|
|00004230| 75 6e 64 65 72 2c 20 62 | 6f 75 6e 64 65 72 2c 20 |under, b|ounder, |
|00004240| 73 72 63 43 6f 70 79 2c | 20 4e 49 4c 29 3b 0d 09 |srcCopy,| NIL);..|
|00004250| 09 09 09 09 09 0d 09 09 | 09 6f 6e 65 42 69 74 50 |........|.oneBitP|
|00004260| 4d 61 70 20 3a 3d 20 20 | 47 65 74 4d 61 70 28 67 |Map := |GetMap(g|
|00004270| 31 42 69 74 48 61 6e 64 | 6c 65 29 3b 0d 09 09 09 |1BitHand|le);....|
|00004280| 6f 6e 65 42 69 74 50 4d | 61 70 5e 2e 62 61 73 65 |oneBitPM|ap^.base|
|00004290| 41 64 64 72 20 3a 3d 20 | 40 63 72 73 72 4d 61 73 |Addr := |@crsrMas|
|000042a0| 6b 3b 0d 09 09 09 41 64 | 64 53 65 61 72 63 68 28 |k;....Ad|dSearch(|
|000042b0| 40 47 69 6d 6d 65 42 6c | 61 63 6b 41 6e 64 57 68 |@GimmeBl|ackAndWh|
|000042c0| 69 74 65 29 3b 0d 09 09 | 09 43 6f 70 79 42 69 74 |ite);...|.CopyBit|
|000042d0| 73 28 42 69 74 4d 61 70 | 50 74 72 28 63 72 73 72 |s(BitMap|Ptr(crsr|
|000042e0| 4d 61 70 5e 29 5e 2c 20 | 6f 6e 65 42 69 74 50 4d |Map^)^, |oneBitPM|
|000042f0| 61 70 5e 2c 0d 09 09 09 | 09 09 09 62 6f 75 6e 64 |ap^,....|...bound|
|00004300| 65 72 2c 20 62 6f 75 6e | 64 65 72 2c 20 73 72 63 |er, boun|der, src|
|00004310| 43 6f 70 79 2c 20 4e 49 | 4c 29 3b 0d 09 09 09 44 |Copy, NI|L);....D|
|00004320| 65 6c 53 65 61 72 63 68 | 28 40 47 69 6d 6d 65 42 |elSearch|(@GimmeB|
|00004330| 6c 61 63 6b 41 6e 64 57 | 68 69 74 65 29 3b 0d 09 |lackAndW|hite);..|
|00004340| 09 45 4e 44 3b 0d 09 09 | 63 72 73 72 58 56 61 6c |.END;...|crsrXVal|
|00004350| 69 64 20 3a 3d 20 30 3b | 0d 09 09 63 72 73 72 49 |id := 0;|...crsrI|
|00004360| 44 20 3a 3d 20 47 65 74 | 43 54 53 65 65 64 3b 0d |D := Get|CTSeed;.|
|00004370| 09 45 4e 44 3b 0d 09 48 | 55 6e 6c 6f 63 6b 28 48 |.END;..H|Unlock(H|
|00004380| 61 6e 64 6c 65 28 67 43 | 75 72 73 6f 72 29 29 3b |andle(gC|ursor));|
|00004390| 0d 45 4e 44 3b 20 7b 53 | 65 74 4f 62 6a 43 75 72 |.END; {S|etObjCur|
|000043a0| 73 6f 72 7d 0d 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |sor}...{|$S Main}|
|000043b0| 0d 46 55 4e 43 54 49 4f | 4e 20 47 65 74 49 6e 76 |.FUNCTIO|N GetInv|
|000043c0| 61 6c 45 78 74 65 6e 74 | 20 28 77 69 6e 64 6f 77 |alExtent| (window|
|000043d0| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 20 73 68 61 |: Window|Ptr; sha|
|000043e0| 70 65 3a 20 53 68 61 70 | 65 73 29 20 3a 20 52 65 |pe: Shap|es) : Re|
|000043f0| 63 74 3b 0d 0d 7b 52 65 | 74 75 72 6e 20 74 68 65 |ct;..{Re|turn the|
|00004400| 20 73 68 61 70 65 27 73 | 20 65 78 74 65 6e 74 2c | shape's| extent,|
|00004410| 20 61 64 6a 75 73 74 65 | 64 20 66 6f 72 20 74 68 | adjuste|d for th|
|00004420| 65 20 70 65 6e 73 69 7a | 65 20 6f 66 20 74 68 65 |e pensiz|e of the|
|00004430| 20 66 72 61 6d 65 2e 7d | 0d 0d 56 41 52 0d 09 72 | frame.}|..VAR..r|
|00004440| 09 3a 20 52 65 63 74 3b | 0d 09 0d 42 45 47 49 4e |.: Rect;|...BEGIN|
|00004450| 0d 09 72 20 3a 3d 20 4f | 66 66 73 63 72 65 65 6e |..r := O|ffscreen|
|00004460| 50 65 65 6b 28 77 69 6e | 64 6f 77 29 5e 2e 66 53 |Peek(win|dow)^.fS|
|00004470| 68 61 70 65 73 5b 73 68 | 61 70 65 5d 2e 65 78 74 |hapes[sh|ape].ext|
|00004480| 65 6e 74 3b 0d 09 57 49 | 54 48 20 72 20 44 4f 20 |ent;..WI|TH r DO |
|00004490| 42 45 47 49 4e 0d 09 09 | 72 69 67 68 74 20 3a 3d |BEGIN...|right :=|
|000044a0| 20 72 69 67 68 74 20 2b | 20 6b 46 72 61 6d 65 50 | right +| kFrameP|
|000044b0| 65 6e 48 3b 0d 09 09 62 | 6f 74 74 6f 6d 20 3a 3d |enH;...b|ottom :=|
|000044c0| 20 62 6f 74 74 6f 6d 20 | 2b 20 6b 46 72 61 6d 65 | bottom |+ kFrame|
|000044d0| 50 65 6e 56 3b 0d 09 45 | 4e 44 3b 0d 09 47 65 74 |PenV;..E|ND;..Get|
|000044e0| 49 6e 76 61 6c 45 78 74 | 65 6e 74 20 3a 3d 20 72 |InvalExt|ent := r|
|000044f0| 3b 0d 45 4e 44 3b 20 7b | 47 65 74 49 6e 76 61 6c |;.END; {|GetInval|
|00004500| 45 78 74 65 6e 74 7d 0d | 0d 0d 7b 24 53 20 4d 61 |Extent}.|..{$S Ma|
|00004510| 69 6e 7d 0d 50 52 4f 43 | 45 44 55 52 45 20 43 68 |in}.PROC|EDURE Ch|
|00004520| 61 6e 67 65 43 6f 6c 6f | 72 20 28 77 69 6e 64 6f |angeColo|r (windo|
|00004530| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 29 3b 0d 0d |w: Windo|wPtr);..|
|00004540| 7b 44 69 73 70 6c 61 79 | 20 74 68 65 20 43 6f 6c |{Display| the Col|
|00004550| 6f 72 20 50 69 63 6b 65 | 72 20 64 69 61 6c 6f 67 |or Picke|r dialog|
|00004560| 2e 20 4e 6f 74 65 20 74 | 68 61 74 20 74 68 69 73 |. Note t|hat this|
|00004570| 20 69 73 0d 20 6f 6e 6c | 79 20 63 61 6c 6c 65 64 | is. onl|y called|
|00004580| 20 69 6e 20 43 6f 6c 6f | 72 20 51 44 20 65 6e 76 | in Colo|r QD env|
|00004590| 69 72 6f 6e 6d 65 6e 74 | 73 2e 7d 0d 0d 56 41 52 |ironment|s.}..VAR|
|000045a0| 0d 09 70 61 6c 09 09 09 | 09 09 3a 20 50 61 6c 65 |..pal...|..: Pale|
|000045b0| 74 74 65 48 61 6e 64 6c | 65 3b 0d 09 69 6e 43 6f |tteHandl|e;..inCo|
|000045c0| 6c 6f 72 2c 20 6f 75 74 | 43 6f 6c 6f 72 09 3a 20 |lor, out|Color.: |
|000045d0| 52 47 42 43 6f 6c 6f 72 | 3b 0d 09 77 68 65 72 65 |RGBColor|;..where|
|000045e0| 09 09 09 09 3a 20 50 6f | 69 6e 74 3b 0d 09 72 09 |....: Po|int;..r.|
|000045f0| 09 09 09 09 3a 20 52 65 | 63 74 3b 0d 09 61 53 74 |....: Re|ct;..aSt|
|00004600| 72 69 6e 67 09 09 09 09 | 3a 20 53 74 72 69 6e 67 |ring....|: String|
|00004610| 48 61 6e 64 6c 65 3b 0d | 09 70 72 6f 6d 70 74 09 |Handle;.|.prompt.|
|00004620| 09 09 09 3a 20 53 74 72 | 32 35 35 3b 0d 0d 42 45 |...: Str|255;..BE|
|00004630| 47 49 4e 0d 09 70 61 6c | 20 3a 3d 20 47 65 74 50 |GIN..pal| := GetP|
|00004640| 61 6c 65 74 74 65 28 77 | 69 6e 64 6f 77 29 3b 0d |alette(w|indow);.|
|00004650| 09 57 49 54 48 20 4f 66 | 66 73 63 72 65 65 6e 50 |.WITH Of|fscreenP|
|00004660| 65 65 6b 28 77 69 6e 64 | 6f 77 29 5e 20 44 4f 20 |eek(wind|ow)^ DO |
|00004670| 42 45 47 49 4e 0d 09 09 | 47 65 74 45 6e 74 72 79 |BEGIN...|GetEntry|
|00004680| 43 6f 6c 6f 72 28 70 61 | 6c 2c 20 4f 52 44 28 67 |Color(pa|l, ORD(g|
|00004690| 53 68 61 70 65 29 20 2b | 20 32 2c 20 69 6e 43 6f |Shape) +| 2, inCo|
|000046a0| 6c 6f 72 29 3b 0d 09 09 | 53 65 74 50 74 28 77 68 |lor);...|SetPt(wh|
|000046b0| 65 72 65 2c 20 6b 44 49 | 4c 65 66 74 2c 20 6b 44 |ere, kDI|Left, kD|
|000046c0| 49 54 6f 70 29 3b 0d 09 | 09 61 53 74 72 69 6e 67 |ITop);..|.aString|
|000046d0| 20 3a 3d 20 47 65 74 53 | 74 72 69 6e 67 28 6b 43 | := GetS|tring(kC|
|000046e0| 6f 6c 6f 72 50 72 6f 6d | 70 74 29 3b 0d 09 09 49 |olorProm|pt);...I|
|000046f0| 46 20 61 53 74 72 69 6e | 67 20 3c 3e 20 4e 49 4c |F aStrin|g <> NIL|
|00004700| 20 54 48 45 4e 0d 09 09 | 09 70 72 6f 6d 70 74 20 | THEN...|.prompt |
|00004710| 3a 3d 20 61 53 74 72 69 | 6e 67 5e 5e 0d 09 09 45 |:= aStri|ng^^...E|
|00004720| 4c 53 45 0d 09 09 09 70 | 72 6f 6d 70 74 20 3a 3d |LSE....p|rompt :=|
|00004730| 20 27 27 3b 0d 09 09 49 | 46 20 47 65 74 43 6f 6c | '';...I|F GetCol|
|00004740| 6f 72 28 77 68 65 72 65 | 2c 20 70 72 6f 6d 70 74 |or(where|, prompt|
|00004750| 2c 20 69 6e 43 6f 6c 6f | 72 2c 20 6f 75 74 43 6f |, inColo|r, outCo|
|00004760| 6c 6f 72 29 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |lor) THE|N BEGIN.|
|00004770| 09 09 09 53 65 74 45 6e | 74 72 79 43 6f 6c 6f 72 |...SetEn|tryColor|
|00004780| 28 70 61 6c 2c 20 4f 52 | 44 28 67 53 68 61 70 65 |(pal, OR|D(gShape|
|00004790| 29 20 2b 20 32 2c 20 6f | 75 74 43 6f 6c 6f 72 29 |) + 2, o|utColor)|
|000047a0| 3b 0d 09 09 09 41 63 74 | 69 76 61 74 65 50 61 6c |;....Act|ivatePal|
|000047b0| 65 74 74 65 28 77 69 6e | 64 6f 77 29 3b 0d 09 09 |ette(win|dow);...|
|000047c0| 09 53 65 74 4f 62 6a 43 | 75 72 73 6f 72 28 77 69 |.SetObjC|ursor(wi|
|000047d0| 6e 64 6f 77 29 3b 0d 09 | 09 09 49 46 20 4e 4f 54 |ndow);..|..IF NOT|
|000047e0| 20 28 66 53 68 61 70 65 | 73 5b 67 53 68 61 70 65 | (fShape|s[gShape|
|000047f0| 5d 2e 6e 65 78 74 20 3d | 20 53 68 61 70 65 73 28 |].next =| Shapes(|
|00004800| 6b 4e 6f 74 44 72 61 77 | 6e 29 29 20 54 48 45 4e |kNotDraw|n)) THEN|
|00004810| 20 42 45 47 49 4e 0d 09 | 09 09 09 72 20 3a 3d 20 | BEGIN..|...r := |
|00004820| 47 65 74 49 6e 76 61 6c | 45 78 74 65 6e 74 28 77 |GetInval|Extent(w|
|00004830| 69 6e 64 6f 77 2c 20 67 | 53 68 61 70 65 29 3b 0d |indow, g|Shape);.|
|00004840| 09 09 09 09 53 65 74 50 | 6f 72 74 28 77 69 6e 64 |....SetP|ort(wind|
|00004850| 6f 77 29 3b 0d 09 09 09 | 09 49 6e 76 61 6c 52 65 |ow);....|.InvalRe|
|00004860| 63 74 28 72 29 3b 0d 09 | 09 09 45 4e 44 3b 0d 09 |ct(r);..|..END;..|
|00004870| 09 45 4e 44 3b 0d 09 45 | 4e 44 3b 0d 45 4e 44 3b |.END;..E|ND;.END;|
|00004880| 20 7b 43 68 61 6e 67 65 | 43 6f 6c 6f 72 7d 0d 0d | {Change|Color}..|
|00004890| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|000048a0| 44 55 52 45 20 44 6f 4e | 65 77 57 69 6e 64 6f 77 |DURE DoN|ewWindow|
|000048b0| 3b 0d 0d 7b 57 65 20 77 | 69 6c 6c 20 61 6c 6c 6f |;..{We w|ill allo|
|000048c0| 63 61 74 65 20 6f 75 72 | 20 6f 77 6e 20 77 69 6e |cate our| own win|
|000048d0| 64 6f 77 20 73 74 6f 72 | 61 67 65 20 69 6e 73 74 |dow stor|age inst|
|000048e0| 65 61 64 20 6f 66 20 6c | 65 74 74 69 6e 67 20 74 |ead of l|etting t|
|000048f0| 68 65 20 57 69 6e 64 6f | 77 0d 20 4d 61 6e 61 67 |he Windo|w. Manag|
|00004900| 65 72 20 64 6f 20 69 74 | 20 66 6f 72 20 74 77 6f |er do it| for two|
|00004910| 20 72 65 61 73 6f 6e 73 | 2e 20 4f 6e 65 2c 20 47 | reasons|. One, G|
|00004920| 65 74 4e 65 77 57 69 6e | 64 6f 77 20 6c 6f 63 6b |etNewWin|dow lock|
|00004930| 73 20 74 68 65 20 27 57 | 49 4e 44 27 20 72 65 73 |s the 'W|IND' res|
|00004940| 6f 75 72 63 65 0d 20 68 | 61 6e 64 6c 65 20 62 65 |ource. h|andle be|
|00004950| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 4e 65 77 |fore cal|ling New|
|00004960| 57 69 6e 64 6f 77 20 61 | 6e 64 20 74 68 69 73 20 |Window a|nd this |
|00004970| 63 61 6e 20 6c 65 61 64 | 20 74 6f 20 68 65 61 70 |can lead| to heap|
|00004980| 20 66 72 61 67 6d 65 6e | 74 61 74 69 6f 6e 0d 20 | fragmen|tation. |
|00004990| 69 6e 20 6c 6f 77 20 6d | 65 6d 6f 72 79 20 73 69 |in low m|emory si|
|000049a0| 74 75 61 74 69 6f 6e 73 | 2e 20 54 77 6f 2c 20 69 |tuations|. Two, i|
|000049b0| 74 20 74 61 6b 65 73 20 | 6a 75 73 74 20 61 73 20 |t takes |just as |
|000049c0| 6d 75 63 68 20 74 69 6d | 65 20 66 6f 72 20 4e 65 |much tim|e for Ne|
|000049d0| 77 57 69 6e 64 6f 77 0d | 20 74 6f 20 67 65 74 20 |wWindow.| to get |
|000049e0| 74 68 65 20 6d 65 6d 6f | 72 79 20 61 73 20 69 74 |the memo|ry as it|
|000049f0| 20 64 6f 65 73 20 66 6f | 72 20 75 73 20 74 6f 20 | does fo|r us to |
|00004a00| 67 65 74 20 69 74 2e 20 | 54 68 72 65 65 2c 20 74 |get it. |Three, t|
|00004a10| 68 65 72 65 20 61 72 65 | 20 54 48 52 45 45 0d 20 |here are| THREE. |
|00004a20| 72 65 61 73 6f 6e 73 20 | 77 65 20 77 69 6c 6c 20 |reasons |we will |
|00004a30| 61 6c 6c 6f 63 61 74 65 | 20 6f 75 72 20 6f 77 6e |allocate| our own|
|00004a40| 20 77 69 6e 64 6f 77 20 | 73 74 6f 72 61 67 65 20 | window |storage |
|00004a50| 69 6e 73 74 65 61 64 20 | 6f 66 20 6c 65 74 74 69 |instead |of letti|
|00004a60| 6e 67 20 74 68 65 0d 20 | 57 69 6e 64 6f 77 20 4d |ng the. |Window M|
|00004a70| 61 6e 61 67 65 72 20 64 | 6f 20 69 74 2e 20 4f 6e |anager d|o it. On|
|00004a80| 65 2c 20 47 65 74 4e 65 | 77 57 69 6e 64 6f 77 20 |e, GetNe|wWindow |
|00004a90| 6c 6f 63 6b 73 20 65 74 | 63 2e 20 65 74 63 2e 20 |locks et|c. etc. |
|00004aa0| 54 77 6f 2c 20 69 74 20 | 74 61 6b 65 73 0d 20 6a |Two, it |takes. j|
|00004ab0| 75 73 74 20 61 73 20 6d | 75 63 68 20 74 69 6d 65 |ust as m|uch time|
|00004ac0| 2c 20 65 74 63 2e 20 65 | 74 63 2e 20 41 6e 64 20 |, etc. e|tc. And |
|00004ad0| 74 68 72 65 65 2c 20 74 | 68 69 73 20 77 61 79 20 |three, t|his way |
|00004ae0| 77 65 20 63 61 6e 20 61 | 6c 6c 6f 63 61 74 65 20 |we can a|llocate |
|00004af0| 6c 61 72 67 65 72 20 72 | 65 63 6f 72 64 73 0d 20 |larger r|ecords. |
|00004b00| 77 68 65 72 65 20 74 68 | 65 20 65 78 74 72 61 20 |where th|e extra |
|00004b10| 73 70 61 63 65 20 63 61 | 6e 20 62 65 20 75 73 65 |space ca|n be use|
|00004b20| 64 20 74 6f 20 63 6f 6e | 6e 65 63 74 20 6f 74 68 |d to con|nect oth|
|00004b30| 65 72 2c 20 72 65 6c 61 | 74 65 64 20 64 61 74 61 |er, rela|ted data|
|00004b40| 20 73 74 72 75 63 74 75 | 72 65 73 2e 0d 20 46 6f | structu|res.. Fo|
|00004b50| 75 72 2c 20 74 68 65 72 | 65 20 69 73 20 6e 6f 20 |ur, ther|e is no |
|00004b60| 66 6f 75 72 74 68 20 72 | 65 61 73 6f 6e 2e 7d 0d |fourth r|eason.}.|
|00004b70| 0d 56 41 52 0d 09 70 09 | 09 09 09 3a 20 50 74 72 |.VAR..p.|...: Ptr|
|00004b80| 3b 0d 09 77 69 6e 64 6f | 77 09 09 09 3a 20 57 69 |;..windo|w...: Wi|
|00004b90| 6e 64 6f 77 50 74 72 3b | 0d 09 6e 6f 42 75 66 66 |ndowPtr;|..noBuff|
|00004ba0| 73 50 6c 65 61 73 65 09 | 3a 20 42 4f 4f 4c 45 41 |sPlease.|: BOOLEA|
|00004bb0| 4e 3b 0d 09 74 69 74 6c | 65 09 09 09 3a 20 53 74 |N;..titl|e...: St|
|00004bc0| 72 32 35 35 3b 0d 09 73 | 68 61 70 65 09 09 09 3a |r255;..s|hape...:|
|00004bd0| 20 53 68 61 70 65 73 3b | 0d 09 65 6d 70 74 79 52 | Shapes;|..emptyR|
|00004be0| 65 63 74 09 09 3a 20 52 | 65 63 74 3b 0d 0d 42 45 |ect..: R|ect;..BE|
|00004bf0| 47 49 4e 0d 09 70 20 3a | 3d 20 4e 65 77 50 74 72 |GIN..p :|= NewPtr|
|00004c00| 28 53 49 5a 45 4f 46 28 | 4f 66 66 73 63 72 65 65 |(SIZEOF(|Offscree|
|00004c10| 6e 52 65 63 6f 72 64 29 | 29 3b 0d 09 46 61 69 6c |nRecord)|);..Fail|
|00004c20| 4e 49 4c 4d 73 67 28 70 | 2c 20 65 4e 6f 4d 65 6d |NILMsg(p|, eNoMem|
|00004c30| 6f 72 79 29 3b 0d 09 77 | 69 6e 64 6f 77 20 3a 3d |ory);..w|indow :=|
|00004c40| 20 4e 49 4c 3b 0d 09 49 | 46 20 67 4d 61 63 2e 68 | NIL;..I|F gMac.h|
|00004c50| 61 73 43 6f 6c 6f 72 51 | 44 20 54 48 45 4e 0d 09 |asColorQ|D THEN..|
|00004c60| 09 77 69 6e 64 6f 77 20 | 3a 3d 20 47 65 74 4e 65 |.window |:= GetNe|
|00004c70| 77 43 57 69 6e 64 6f 77 | 28 72 57 69 6e 64 6f 77 |wCWindow|(rWindow|
|00004c80| 2c 20 70 2c 20 57 69 6e | 64 6f 77 50 74 72 28 2d |, p, Win|dowPtr(-|
|00004c90| 31 29 29 0d 09 45 4c 53 | 45 0d 09 09 77 69 6e 64 |1))..ELS|E...wind|
|00004ca0| 6f 77 20 3a 3d 20 47 65 | 74 4e 65 77 57 69 6e 64 |ow := Ge|tNewWind|
|00004cb0| 6f 77 28 72 57 69 6e 64 | 6f 77 2c 20 70 2c 20 57 |ow(rWind|ow, p, W|
|00004cc0| 69 6e 64 6f 77 50 74 72 | 28 2d 31 29 29 3b 0d 09 |indowPtr|(-1));..|
|00004cd0| 46 61 69 6c 4e 49 4c 4d | 73 67 28 77 69 6e 64 6f |FailNILM|sg(windo|
|00004ce0| 77 2c 20 65 4e 6f 4d 65 | 6d 6f 72 79 29 3b 0d 09 |w, eNoMe|mory);..|
|00004cf0| 0d 09 57 49 54 48 20 4f | 66 66 73 63 72 65 65 6e |..WITH O|ffscreen|
|00004d00| 50 65 65 6b 28 77 69 6e | 64 6f 77 29 5e 20 44 4f |Peek(win|dow)^ DO|
|00004d10| 20 42 45 47 49 4e 0d 09 | 09 66 42 61 63 6b 48 61 | BEGIN..|.fBackHa|
|00004d20| 6e 64 6c 65 20 3a 3d 20 | 4e 49 4c 3b 0d 09 09 66 |ndle := |NIL;...f|
|00004d30| 45 64 69 74 48 61 6e 64 | 6c 65 20 3a 3d 20 4e 49 |EditHand|le := NI|
|00004d40| 4c 3b 0d 09 09 66 48 61 | 73 42 61 63 6b 20 3a 3d |L;...fHa|sBack :=|
|00004d50| 20 46 41 4c 53 45 3b 0d | 09 09 66 48 61 73 45 64 | FALSE;.|..fHasEd|
|00004d60| 69 74 20 3a 3d 20 46 41 | 4c 53 45 3b 0d 09 09 49 |it := FA|LSE;...I|
|00004d70| 46 20 67 55 73 65 42 61 | 63 6b 20 54 48 45 4e 0d |F gUseBa|ck THEN.|
|00004d80| 09 09 09 49 46 20 4e 65 | 77 4f 66 66 73 63 72 65 |...IF Ne|wOffscre|
|00004d90| 65 6e 46 6f 72 57 69 6e | 64 6f 77 28 77 69 6e 64 |enForWin|dow(wind|
|00004da0| 6f 77 2c 20 6e 6f 42 75 | 66 66 73 50 6c 65 61 73 |ow, noBu|ffsPleas|
|00004db0| 65 2c 20 66 42 61 63 6b | 48 61 6e 64 6c 65 29 20 |e, fBack|Handle) |
|00004dc0| 3d 20 6e 6f 45 72 72 20 | 54 48 45 4e 3b 0d 09 09 |= noErr |THEN;...|
|00004dd0| 49 46 20 67 55 73 65 45 | 64 69 74 20 54 48 45 4e |IF gUseE|dit THEN|
|00004de0| 0d 09 09 09 49 46 20 4e | 65 77 4f 66 66 73 63 72 |....IF N|ewOffscr|
|00004df0| 65 65 6e 46 6f 72 57 69 | 6e 64 6f 77 28 77 69 6e |eenForWi|ndow(win|
|00004e00| 64 6f 77 2c 20 6e 6f 42 | 75 66 66 73 50 6c 65 61 |dow, noB|uffsPlea|
|00004e10| 73 65 2c 20 66 45 64 69 | 74 48 61 6e 64 6c 65 29 |se, fEdi|tHandle)|
|00004e20| 20 3d 20 6e 6f 45 72 72 | 20 54 48 45 4e 3b 0d 09 | = noErr| THEN;..|
|00004e30| 09 53 65 74 52 65 63 74 | 28 65 6d 70 74 79 52 65 |.SetRect|(emptyRe|
|00004e40| 63 74 2c 20 30 2c 20 30 | 2c 20 30 2c 20 30 29 3b |ct, 0, 0|, 0, 0);|
|00004e50| 0d 09 09 46 4f 52 20 73 | 68 61 70 65 20 3a 3d 20 |...FOR s|hape := |
|00004e60| 6b 4f 76 61 6c 20 54 4f | 20 6b 50 49 43 54 20 44 |kOval TO| kPICT D|
|00004e70| 4f 20 42 45 47 49 4e 0d | 09 09 09 66 53 68 61 70 |O BEGIN.|...fShap|
|00004e80| 65 73 5b 73 68 61 70 65 | 5d 2e 6e 65 78 74 20 3a |es[shape|].next :|
|00004e90| 3d 20 53 68 61 70 65 73 | 28 6b 4e 6f 74 44 72 61 |= Shapes|(kNotDra|
|00004ea0| 77 6e 29 3b 0d 09 09 09 | 66 53 68 61 70 65 73 5b |wn);....|fShapes[|
|00004eb0| 73 68 61 70 65 5d 2e 65 | 78 74 65 6e 74 20 3a 3d |shape].e|xtent :=|
|00004ec0| 20 65 6d 70 74 79 52 65 | 63 74 3b 0d 09 09 45 4e | emptyRe|ct;...EN|
|00004ed0| 44 3b 0d 09 09 66 46 69 | 72 73 74 20 3a 3d 20 53 |D;...fFi|rst := S|
|00004ee0| 68 61 70 65 73 28 6b 4e | 6f 74 44 72 61 77 6e 29 |hapes(kN|otDrawn)|
|00004ef0| 3b 0d 09 09 66 45 64 69 | 74 20 3a 3d 20 53 68 61 |;...fEdi|t := Sha|
|00004f00| 70 65 73 28 6b 4e 6f 74 | 44 72 61 77 6e 29 3b 0d |pes(kNot|Drawn);.|
|00004f10| 09 45 4e 44 3b 0d 09 0d | 09 43 68 65 63 6b 54 69 |.END;...|.CheckTi|
|00004f20| 74 6c 65 28 77 69 6e 64 | 6f 77 2c 20 46 41 4c 53 |tle(wind|ow, FALS|
|00004f30| 45 29 3b 0d 09 49 46 20 | 67 4d 61 63 2e 68 61 73 |E);..IF |gMac.has|
|00004f40| 43 6f 6c 6f 72 51 44 20 | 54 48 45 4e 0d 09 09 53 |ColorQD |THEN...S|
|00004f50| 65 74 4f 62 6a 43 75 72 | 73 6f 72 28 77 69 6e 64 |etObjCur|sor(wind|
|00004f60| 6f 77 29 3b 0d 45 4e 44 | 3b 20 7b 44 6f 4e 65 77 |ow);.END|; {DoNew|
|00004f70| 57 69 6e 64 6f 77 7d 0d | 0d 0d 7b 24 53 20 49 6e |Window}.|..{$S In|
|00004f80| 69 74 69 61 6c 69 7a 65 | 7d 0d 50 52 4f 43 45 44 |itialize|}.PROCED|
|00004f90| 55 52 45 20 49 6e 69 74 | 69 61 6c 69 7a 65 3b 0d |URE Init|ialize;.|
|00004fa0| 0d 7b 53 65 74 20 75 70 | 20 74 68 65 20 77 68 6f |.{Set up| the who|
|00004fb0| 6c 65 20 77 6f 72 6c 64 | 2c 20 69 6e 63 6c 75 64 |le world|, includ|
|00004fc0| 69 6e 67 20 67 6c 6f 62 | 61 6c 20 76 61 72 69 61 |ing glob|al varia|
|00004fd0| 62 6c 65 73 2c 20 54 6f | 6f 6c 62 6f 78 20 6d 61 |bles, To|olbox ma|
|00004fe0| 6e 61 67 65 72 73 2c 0d | 20 61 6e 64 20 6d 65 6e |nagers,.| and men|
|00004ff0| 75 73 2e 20 57 65 20 61 | 6c 73 6f 20 63 72 65 61 |us. We a|lso crea|
|00005000| 74 65 20 6f 6e 65 20 61 | 70 70 6c 69 63 61 74 69 |te one a|pplicati|
|00005010| 6f 6e 20 77 69 6e 64 6f | 77 20 61 74 20 74 68 69 |on windo|w at thi|
|00005020| 73 20 74 69 6d 65 2e 0d | 20 53 69 6e 63 65 20 77 |s time..| Since w|
|00005030| 69 6e 64 6f 77 20 73 74 | 6f 72 61 67 65 20 69 73 |indow st|orage is|
|00005040| 20 6e 6f 6e 2d 72 65 6c | 6f 63 61 74 65 61 62 6c | non-rel|ocateabl|
|00005050| 65 2c 20 68 6f 77 20 61 | 6e 64 20 77 68 65 6e 20 |e, how a|nd when |
|00005060| 74 6f 20 61 6c 6c 6f 63 | 61 74 65 20 73 70 61 63 |to alloc|ate spac|
|00005070| 65 0d 20 66 6f 72 20 77 | 69 6e 64 6f 77 73 20 69 |e. for w|indows i|
|00005080| 73 20 76 65 72 79 20 69 | 6d 70 6f 72 74 61 6e 74 |s very i|mportant|
|00005090| 20 73 6f 20 74 68 61 74 | 20 68 65 61 70 20 66 72 | so that| heap fr|
|000050a0| 61 67 6d 65 6e 74 61 74 | 69 6f 6e 20 64 6f 65 73 |agmentat|ion does|
|000050b0| 20 6e 6f 74 20 6f 63 63 | 75 72 2e 0d 20 57 69 6e | not occ|ur.. Win|
|000050c0| 64 6f 77 20 73 74 6f 72 | 61 67 65 20 63 61 6e 20 |dow stor|age can |
|000050d0| 64 69 66 66 65 72 20 77 | 69 64 65 6c 79 20 61 6d |differ w|idely am|
|000050e0| 6f 6e 67 73 74 20 61 70 | 70 6c 69 63 61 74 69 6f |ongst ap|plicatio|
|000050f0| 6e 73 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |ns depen|ding on |
|00005100| 68 6f 77 20 6d 61 6e 79 | 0d 20 77 69 6e 64 6f 77 |how many|. window|
|00005110| 73 20 61 72 65 20 63 72 | 65 61 74 65 64 20 61 6e |s are cr|eated an|
|00005120| 64 20 64 69 73 70 6f 73 | 65 64 2e 20 49 66 20 61 |d dispos|ed. If a|
|00005130| 20 66 61 69 6c 75 72 65 | 20 6f 63 63 75 72 73 20 | failure| occurs |
|00005140| 68 65 72 65 2c 20 77 65 | 20 77 69 6c 6c 20 63 6f |here, we| will co|
|00005150| 6e 73 69 64 65 72 0d 20 | 74 68 61 74 20 74 68 65 |nsider. |that the|
|00005160| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 69 73 20 | applica|tion is |
|00005170| 69 6e 20 73 75 63 68 20 | 62 61 64 20 73 68 61 70 |in such |bad shap|
|00005180| 65 20 74 68 61 74 20 77 | 65 20 73 68 6f 75 6c 64 |e that w|e should|
|00005190| 20 6a 75 73 74 20 65 78 | 69 74 2e 20 59 6f 75 72 | just ex|it. Your|
|000051a0| 20 65 72 72 6f 72 0d 20 | 68 61 6e 64 6c 69 6e 67 | error. |handling|
|000051b0| 20 6d 61 79 20 64 69 66 | 66 65 72 2c 20 62 75 74 | may dif|fer, but|
|000051c0| 20 74 68 65 20 63 68 65 | 63 6b 73 20 73 68 6f 75 | the che|cks shou|
|000051d0| 6c 64 20 73 74 69 6c 6c | 20 62 65 20 6d 61 64 65 |ld still| be made|
|000051e0| 2e 7d 0d 20 0d 54 59 50 | 45 0d 09 63 72 73 43 6f |.}. .TYP|E..crsCo|
|000051f0| 6c 6f 72 73 20 3d 20 41 | 52 52 41 59 5b 30 2e 2e |lors = A|RRAY[0..|
|00005200| 32 5d 20 4f 46 20 43 6f | 6c 6f 72 53 70 65 63 3b |2] OF Co|lorSpec;|
|00005210| 0d 0d 56 41 52 0d 09 6d | 65 6e 75 42 61 72 09 09 |..VAR..m|enuBar..|
|00005220| 09 3a 20 48 61 6e 64 6c | 65 3b 0d 09 69 67 6e 6f |.: Handl|e;..igno|
|00005230| 72 65 45 72 72 6f 72 09 | 09 3a 20 4f 53 45 72 72 |reError.|.: OSErr|
|00005240| 3b 0d 09 74 6f 74 61 6c | 2c 20 63 6f 6e 74 69 67 |;..total|, contig|
|00005250| 09 3a 20 4c 6f 6e 67 49 | 6e 74 3b 0d 09 69 67 6e |.: LongI|nt;..ign|
|00005260| 6f 72 65 52 65 73 75 6c | 74 09 3a 20 42 4f 4f 4c |oreResul|t.: BOOL|
|00005270| 45 41 4e 3b 0d 09 65 76 | 65 6e 74 09 09 09 3a 20 |EAN;..ev|ent...: |
|00005280| 45 76 65 6e 74 52 65 63 | 6f 72 64 3b 0d 09 63 6f |EventRec|ord;..co|
|00005290| 75 6e 74 09 09 09 3a 20 | 49 4e 54 45 47 45 52 3b |unt...: |INTEGER;|
|000052a0| 0d 09 66 69 09 09 09 09 | 3a 20 46 61 69 6c 49 6e |..fi....|: FailIn|
|000052b0| 66 6f 3b 0d 09 63 6f 6c | 6f 72 73 09 09 09 3a 20 |fo;..col|ors...: |
|000052c0| 43 54 61 62 48 61 6e 64 | 6c 65 3b 0d 09 62 6f 75 |CTabHand|le;..bou|
|000052d0| 6e 64 65 72 09 09 09 3a | 20 52 65 63 74 3b 0d 09 |nder...:| Rect;..|
|000052e0| 62 75 66 66 4e 6f 74 4e | 65 65 64 65 64 09 3a 20 |buffNotN|eeded.: |
|000052f0| 42 4f 4f 4c 45 41 4e 3b | 0d 0d 09 50 52 4f 43 45 |BOOLEAN;|...PROCE|
|00005300| 44 55 52 45 20 48 61 6e | 64 6c 65 45 72 72 28 65 |DURE Han|dleErr(e|
|00005310| 72 72 6f 72 3a 20 49 4e | 54 45 47 45 52 3b 20 6d |rror: IN|TEGER; m|
|00005320| 65 73 73 61 67 65 3a 20 | 4c 6f 6e 67 49 6e 74 29 |essage: |LongInt)|
|00005330| 3b 0d 09 42 45 47 49 4e | 0d 09 09 49 46 20 65 72 |;..BEGIN|...IF er|
|00005340| 72 6f 72 20 3e 20 30 20 | 54 48 45 4e 0d 09 09 09 |ror > 0 |THEN....|
|00005350| 41 6c 65 72 74 55 73 65 | 72 28 30 2c 20 65 72 72 |AlertUse|r(0, err|
|00005360| 6f 72 29 0d 09 09 45 4c | 53 45 0d 09 09 09 41 6c |or)...EL|SE....Al|
|00005370| 65 72 74 55 73 65 72 28 | 65 72 72 6f 72 2c 20 6d |ertUser(|error, m|
|00005380| 65 73 73 61 67 65 29 3b | 0d 09 09 45 78 69 74 54 |essage);|...ExitT|
|00005390| 6f 53 68 65 6c 6c 3b 0d | 09 45 4e 44 3b 20 7b 48 |oShell;.|.END; {H|
|000053a0| 61 6e 64 6c 65 45 72 72 | 7d 0d 0d 42 45 47 49 4e |andleErr|}..BEGIN|
|000053b0| 0d 09 67 49 6e 42 61 63 | 6b 67 72 6f 75 6e 64 20 |..gInBac|kground |
|000053c0| 3a 3d 20 46 41 4c 53 45 | 3b 0d 0d 09 49 6e 69 74 |:= FALSE|;...Init|
|000053d0| 47 72 61 66 28 40 74 68 | 65 50 6f 72 74 29 3b 0d |Graf(@th|ePort);.|
|000053e0| 09 49 6e 69 74 46 6f 6e | 74 73 3b 0d 09 49 6e 69 |.InitFon|ts;..Ini|
|000053f0| 74 57 69 6e 64 6f 77 73 | 3b 0d 09 49 6e 69 74 4d |tWindows|;..InitM|
|00005400| 65 6e 75 73 3b 0d 09 54 | 45 49 6e 69 74 3b 0d 09 |enus;..T|EInit;..|
|00005410| 49 6e 69 74 44 69 61 6c | 6f 67 73 28 4e 49 4c 29 |InitDial|ogs(NIL)|
|00005420| 3b 0d 09 49 6e 69 74 43 | 75 72 73 6f 72 3b 0d 09 |;..InitC|ursor;..|
|00005430| 0d 09 49 6e 69 74 4f 66 | 66 73 63 72 65 65 6e 3b |..InitOf|fscreen;|
|00005440| 0d 0d 09 7b 43 61 6c 6c | 20 4f 70 65 6e 44 72 69 |...{Call| OpenDri|
|00005450| 76 65 72 28 27 2e 4d 50 | 50 27 2c 20 72 65 66 6e |ver('.MP|P', refn|
|00005460| 75 6d 29 20 61 74 20 74 | 68 69 73 20 70 6f 69 6e |um) at t|his poin|
|00005470| 74 20 74 6f 20 69 6e 69 | 74 69 61 6c 69 7a 65 20 |t to ini|tialize |
|00005480| 41 70 70 6c 65 54 61 6c | 6b 2c 0d 09 20 69 66 20 |AppleTal|k,.. if |
|00005490| 79 6f 75 20 61 72 65 20 | 75 73 69 6e 67 20 69 74 |you are |using it|
|000054a0| 2e 7d 0d 09 20 0d 09 7b | 4e 4f 54 45 20 2d 2d 20 |.}.. ..{|NOTE -- |
|000054b0| 49 74 20 69 73 20 6e 6f | 20 6c 6f 6e 67 65 72 20 |It is no| longer |
|000054c0| 6e 65 63 65 73 73 61 72 | 79 2c 20 61 6e 64 20 61 |necessar|y, and a|
|000054d0| 63 74 75 61 6c 6c 79 20 | 75 6e 68 65 61 6c 74 68 |ctually |unhealth|
|000054e0| 79 2c 20 74 6f 20 63 68 | 65 63 6b 0d 09 20 50 6f |y, to ch|eck.. Po|
|000054f0| 72 74 42 55 73 65 20 61 | 6e 64 20 53 50 43 6f 6e |rtBUse a|nd SPCon|
|00005500| 66 69 67 20 62 65 66 6f | 72 65 20 6f 70 65 6e 69 |fig befo|re openi|
|00005510| 6e 67 20 41 70 70 6c 65 | 54 61 6c 6b 2e 20 54 68 |ng Apple|Talk. Th|
|00005520| 65 20 64 72 69 76 65 72 | 73 20 61 72 65 20 63 61 |e driver|s are ca|
|00005530| 70 61 62 6c 65 0d 09 20 | 6f 66 20 63 68 65 63 6b |pable.. |of check|
|00005540| 69 6e 67 20 66 6f 72 20 | 70 6f 72 74 20 61 76 61 |ing for |port ava|
|00005550| 69 6c 61 62 69 6c 69 74 | 79 20 74 68 65 6d 73 65 |ilabilit|y themse|
|00005560| 6c 76 65 73 2e 7d 0d 09 | 0d 09 7b 54 68 69 73 20 |lves.}..|..{This |
|00005570| 6e 65 78 74 20 62 69 74 | 20 6f 66 20 63 6f 64 65 |next bit| of code|
|00005580| 20 69 73 20 6e 65 63 65 | 73 73 61 72 79 20 74 6f | is nece|ssary to|
|00005590| 20 61 6c 6c 6f 77 20 74 | 68 65 20 64 65 66 61 75 | allow t|he defau|
|000055a0| 6c 74 20 62 75 74 74 6f | 6e 20 6f 66 20 6f 75 72 |lt butto|n of our|
|000055b0| 0d 09 20 61 6c 65 72 74 | 20 74 6f 20 62 65 20 6f |.. alert| to be o|
|000055c0| 75 74 6c 69 6e 65 64 2e | 7d 0d 09 20 0d 09 46 4f |utlined.|}.. ..FO|
|000055d0| 52 20 63 6f 75 6e 74 20 | 3a 3d 20 31 20 54 4f 20 |R count |:= 1 TO |
|000055e0| 33 20 44 4f 0d 09 09 69 | 67 6e 6f 72 65 52 65 73 |3 DO...i|gnoreRes|
|000055f0| 75 6c 74 20 3a 3d 20 45 | 76 65 6e 74 41 76 61 69 |ult := E|ventAvai|
|00005600| 6c 28 65 76 65 72 79 45 | 76 65 6e 74 2c 20 65 76 |l(everyE|vent, ev|
|00005610| 65 6e 74 29 3b 0d 0d 09 | 43 61 74 63 68 46 61 69 |ent);...|CatchFai|
|00005620| 6c 75 72 65 73 28 66 69 | 2c 20 48 61 6e 64 6c 65 |lures(fi|, Handle|
|00005630| 45 72 72 29 3b 0d 0d 09 | 7b 49 67 6e 6f 72 65 20 |Err);...|{Ignore |
|00005640| 74 68 65 20 65 72 72 6f | 72 20 72 65 74 75 72 6e |the erro|r return|
|00005650| 65 64 20 66 72 6f 6d 20 | 53 79 73 45 6e 76 69 72 |ed from |SysEnvir|
|00005660| 6f 6e 73 3b 20 65 76 65 | 6e 20 69 66 20 61 6e 20 |ons; eve|n if an |
|00005670| 65 72 72 6f 72 20 6f 63 | 63 75 72 72 65 64 2c 0d |error oc|curred,.|
|00005680| 09 20 74 68 65 20 53 79 | 73 45 6e 76 69 72 6f 6e |. the Sy|sEnviron|
|00005690| 73 20 67 6c 75 65 20 77 | 69 6c 6c 20 66 69 6c 6c |s glue w|ill fill|
|000056a0| 20 69 6e 20 74 68 65 20 | 53 79 73 45 6e 76 52 65 | in the |SysEnvRe|
|000056b0| 63 2e 20 59 6f 75 20 63 | 61 6e 20 73 61 76 65 20 |c. You c|an save |
|000056c0| 61 20 72 65 64 75 6e 64 | 61 6e 74 0d 09 20 63 61 |a redund|ant.. ca|
|000056d0| 6c 6c 20 74 6f 20 53 79 | 73 45 6e 76 69 72 6f 6e |ll to Sy|sEnviron|
|000056e0| 73 20 62 79 20 63 61 6c | 6c 69 6e 67 20 69 74 20 |s by cal|ling it |
|000056f0| 61 66 74 65 72 20 69 6e | 69 74 69 61 6c 69 7a 69 |after in|itializi|
|00005700| 6e 67 20 41 70 70 6c 65 | 54 61 6c 6b 2e 7d 0d 09 |ng Apple|Talk.}..|
|00005710| 20 0d 09 69 67 6e 6f 72 | 65 45 72 72 6f 72 20 3a | ..ignor|eError :|
|00005720| 3d 20 53 79 73 45 6e 76 | 69 72 6f 6e 73 28 6b 53 |= SysEnv|irons(kS|
|00005730| 79 73 45 6e 76 69 72 6f | 6e 73 56 65 72 73 69 6f |ysEnviro|nsVersio|
|00005740| 6e 2c 20 67 4d 61 63 29 | 3b 0d 09 0d 09 7b 4d 61 |n, gMac)|;....{Ma|
|00005750| 6b 65 20 73 75 72 65 20 | 74 68 61 74 20 74 68 65 |ke sure |that the|
|00005760| 20 6d 61 63 68 69 6e 65 | 20 68 61 73 20 61 74 20 | machine| has at |
|00005770| 6c 65 61 73 74 20 31 32 | 38 4b 20 52 4f 4d 73 2e |least 12|8K ROMs.|
|00005780| 20 49 66 20 69 74 20 64 | 6f 65 73 6e 27 74 2c 20 | If it d|oesn't, |
|00005790| 65 78 69 74 2e 7d 0d 09 | 0d 09 49 46 20 67 4d 61 |exit.}..|..IF gMa|
|000057a0| 63 2e 6d 61 63 68 69 6e | 65 54 79 70 65 20 3c 20 |c.machin|eType < |
|000057b0| 30 20 54 48 45 4e 0d 09 | 09 46 61 69 6c 75 72 65 |0 THEN..|.Failure|
|000057c0| 28 30 2c 20 65 57 72 6f | 6e 67 4d 61 63 68 69 6e |(0, eWro|ngMachin|
|000057d0| 65 29 3b 0d 09 0d 09 7b | 4d 6f 76 65 20 54 72 61 |e);....{|Move Tra|
|000057e0| 70 41 76 61 69 6c 61 62 | 6c 65 20 63 61 6c 6c 20 |pAvailab|le call |
|000057f0| 74 6f 20 61 66 74 65 72 | 20 53 79 73 45 6e 76 69 |to after| SysEnvi|
|00005800| 72 6f 6e 73 20 73 6f 20 | 74 68 61 74 20 77 65 20 |rons so |that we |
|00005810| 63 61 6e 20 74 65 6c 6c | 0d 09 20 69 6e 20 54 72 |can tell|.. in Tr|
|00005820| 61 70 41 76 61 69 6c 61 | 62 6c 65 20 69 66 20 61 |apAvaila|ble if a|
|00005830| 20 74 6f 6f 6c 20 74 72 | 61 70 20 76 61 6c 75 65 | tool tr|ap value|
|00005840| 20 69 73 20 6f 75 74 20 | 6f 66 20 72 61 6e 67 65 | is out |of range|
|00005850| 2e 7d 0d 09 20 0d 09 67 | 48 61 73 57 61 69 74 4e |.}.. ..g|HasWaitN|
|00005860| 65 78 74 45 76 65 6e 74 | 20 3a 3d 20 54 72 61 70 |extEvent| := Trap|
|00005870| 41 76 61 69 6c 61 62 6c | 65 28 5f 57 61 69 74 4e |Availabl|e(_WaitN|
|00005880| 65 78 74 45 76 65 6e 74 | 2c 20 54 6f 6f 6c 54 72 |extEvent|, ToolTr|
|00005890| 61 70 29 3b 0d 0d 09 7b | 46 69 72 73 74 20 63 68 |ap);...{|First ch|
|000058a0| 65 63 6b 20 74 68 65 20 | 73 69 7a 65 20 6f 66 20 |eck the |size of |
|000058b0| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|000058c0| 68 65 61 70 20 61 67 61 | 69 6e 73 74 20 61 20 76 |heap aga|inst a v|
|000058d0| 61 6c 75 65 0d 09 20 74 | 68 61 74 20 79 6f 75 20 |alue.. t|hat you |
|000058e0| 68 61 76 65 20 64 65 74 | 65 72 6d 69 6e 65 64 20 |have det|ermined |
|000058f0| 69 73 20 74 68 65 20 73 | 6d 61 6c 6c 65 73 74 20 |is the s|mallest |
|00005900| 68 65 61 70 20 74 68 65 | 20 61 70 70 6c 69 63 61 |heap the| applica|
|00005910| 74 69 6f 6e 20 63 61 6e | 20 72 65 61 73 6f 6e 61 |tion can| reasona|
|00005920| 62 6c 79 0d 09 20 77 6f | 72 6b 20 69 6e 2e 20 54 |bly.. wo|rk in. T|
|00005930| 68 69 73 20 6e 75 6d 62 | 65 72 20 73 68 6f 75 6c |his numb|er shoul|
|00005940| 64 20 62 65 20 64 65 72 | 69 76 65 64 20 62 79 20 |d be der|ived by |
|00005950| 65 78 61 6d 69 6e 69 6e | 67 20 74 68 65 20 73 69 |examinin|g the si|
|00005960| 7a 65 20 6f 66 20 74 68 | 65 20 68 65 61 70 20 74 |ze of th|e heap t|
|00005970| 68 61 74 0d 09 20 69 73 | 20 61 63 74 75 61 6c 6c |hat.. is| actuall|
|00005980| 79 20 70 72 6f 76 69 64 | 65 64 20 62 79 20 4d 75 |y provid|ed by Mu|
|00005990| 6c 74 69 46 69 6e 64 65 | 72 20 77 68 65 6e 20 74 |ltiFinde|r when t|
|000059a0| 68 65 20 6d 69 6e 69 6d | 75 6d 20 73 69 7a 65 20 |he minim|um size |
|000059b0| 72 65 71 75 65 73 74 65 | 64 20 69 73 20 75 73 65 |requeste|d is use|
|000059c0| 64 2e 0d 09 20 54 68 65 | 20 64 65 72 69 76 61 74 |d... The| derivat|
|000059d0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 6d 69 6e 69 6d |ion of t|he minim|
|000059e0| 75 6d 20 73 69 7a 65 20 | 72 65 71 75 65 73 74 65 |um size |requeste|
|000059f0| 64 20 66 72 6f 6d 20 4d | 75 6c 74 69 46 69 6e 64 |d from M|ultiFind|
|00005a00| 65 72 20 69 73 20 64 65 | 73 63 72 69 62 65 64 0d |er is de|scribed.|
|00005a10| 09 20 69 6e 20 53 61 6d | 70 6c 65 2e 68 2e 20 54 |. in Sam|ple.h. T|
|00005a20| 68 65 20 63 68 65 63 6b | 20 73 68 6f 75 6c 64 20 |he check| should |
|00005a30| 62 65 20 6d 61 64 65 20 | 62 65 63 61 75 73 65 20 |be made |because |
|00005a40| 74 68 65 20 70 72 65 66 | 65 72 72 65 64 20 73 69 |the pref|erred si|
|00005a50| 7a 65 20 63 61 6e 20 65 | 6e 64 20 75 70 0d 09 20 |ze can e|nd up.. |
|00005a60| 62 65 69 6e 67 20 73 65 | 74 20 73 6d 61 6c 6c 65 |being se|t smalle|
|00005a70| 72 20 74 68 61 6e 20 74 | 68 65 20 6d 69 6e 69 6d |r than t|he minim|
|00005a80| 75 6d 20 73 69 7a 65 20 | 62 79 20 74 68 65 20 75 |um size |by the u|
|00005a90| 73 65 72 2e 20 54 68 69 | 73 20 65 78 74 72 61 20 |ser. Thi|s extra |
|00005aa0| 63 68 65 63 6b 20 61 63 | 74 73 20 74 6f 0d 09 20 |check ac|ts to.. |
|00005ab0| 69 6e 73 75 72 65 20 74 | 68 61 74 20 79 6f 75 72 |insure t|hat your|
|00005ac0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 69 73 20 | applica|tion is |
|00005ad0| 73 74 61 72 74 69 6e 67 | 20 66 72 6f 6d 20 61 20 |starting| from a |
|00005ae0| 73 6f 6c 69 64 20 6d 65 | 6d 6f 72 79 20 66 6f 75 |solid me|mory fou|
|00005af0| 6e 64 61 74 69 6f 6e 2e | 7d 0d 09 20 0d 09 49 46 |ndation.|}.. ..IF|
|00005b00| 20 4f 52 44 28 47 65 74 | 41 70 70 6c 4c 69 6d 69 | ORD(Get|ApplLimi|
|00005b10| 74 29 20 2d 20 4f 52 44 | 28 41 70 70 6c 69 63 5a |t) - ORD|(ApplicZ|
|00005b20| 6f 6e 65 29 20 3c 20 6b | 4d 69 6e 48 65 61 70 20 |one) < k|MinHeap |
|00005b30| 54 48 45 4e 0d 09 09 46 | 61 69 6c 75 72 65 28 30 |THEN...F|ailure(0|
|00005b40| 2c 20 65 53 6d 61 6c 6c | 53 69 7a 65 29 3b 0d 09 |, eSmall|Size);..|
|00005b50| 0d 09 7b 4e 65 78 74 2c | 20 6d 61 6b 65 20 73 75 |..{Next,| make su|
|00005b60| 72 65 20 74 68 61 74 20 | 65 6e 6f 75 67 68 20 6d |re that |enough m|
|00005b70| 65 6d 6f 72 79 20 69 73 | 20 66 72 65 65 20 66 6f |emory is| free fo|
|00005b80| 72 20 79 6f 75 72 20 61 | 70 70 6c 69 63 61 74 69 |r your a|pplicati|
|00005b90| 6f 6e 20 74 6f 20 72 75 | 6e 2e 20 49 74 0d 09 20 |on to ru|n. It.. |
|00005ba0| 69 73 20 70 6f 73 73 69 | 62 6c 65 20 66 6f 72 20 |is possi|ble for |
|00005bb0| 61 20 73 69 74 75 61 74 | 69 6f 6e 20 74 6f 20 61 |a situat|ion to a|
|00005bc0| 72 69 73 65 20 77 68 65 | 72 65 20 74 68 65 20 68 |rise whe|re the h|
|00005bd0| 65 61 70 20 6d 61 79 20 | 68 61 76 65 20 62 65 65 |eap may |have bee|
|00005be0| 6e 20 6f 66 20 72 65 71 | 75 69 72 65 64 0d 09 20 |n of req|uired.. |
|00005bf0| 73 69 7a 65 2c 20 62 75 | 74 20 61 20 6c 61 72 67 |size, bu|t a larg|
|00005c00| 65 20 73 63 72 61 70 20 | 77 61 73 20 6c 6f 61 64 |e scrap |was load|
|00005c10| 65 64 20 77 68 69 63 68 | 20 6c 65 66 74 20 74 6f |ed which| left to|
|00005c20| 6f 20 6c 69 74 74 6c 65 | 20 6d 65 6d 6f 72 79 2e |o little| memory.|
|00005c30| 20 54 6f 20 63 68 65 63 | 6b 20 66 6f 72 0d 09 20 | To chec|k for.. |
|00005c40| 74 68 69 73 2c 20 63 61 | 6c 6c 20 50 75 72 67 65 |this, ca|ll Purge|
|00005c50| 53 70 61 63 65 20 61 6e | 64 20 63 6f 6d 70 61 72 |Space an|d compar|
|00005c60| 65 20 74 68 65 20 72 65 | 73 75 6c 74 20 77 69 74 |e the re|sult wit|
|00005c70| 68 20 61 20 76 61 6c 75 | 65 20 74 68 61 74 20 79 |h a valu|e that y|
|00005c80| 6f 75 20 68 61 76 65 20 | 64 65 74 65 72 6d 69 6e |ou have |determin|
|00005c90| 65 64 0d 09 20 69 73 20 | 74 68 65 20 6d 69 6e 69 |ed.. is |the mini|
|00005ca0| 6d 75 6d 20 61 6d 6f 75 | 6e 74 20 6f 66 20 66 72 |mum amou|nt of fr|
|00005cb0| 65 65 20 6d 65 6d 6f 72 | 79 20 79 6f 75 72 20 61 |ee memor|y your a|
|00005cc0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 6e 65 65 64 73 |pplicati|on needs|
|00005cd0| 20 61 74 20 69 6e 69 74 | 69 61 6c 69 7a 61 74 69 | at init|ializati|
|00005ce0| 6f 6e 2e 0d 09 20 54 68 | 69 73 20 6e 75 6d 62 65 |on... Th|is numbe|
|00005cf0| 72 20 63 61 6e 20 62 65 | 20 64 65 72 69 76 65 64 |r can be| derived|
|00005d00| 20 73 65 76 65 72 61 6c | 20 64 69 66 66 65 72 65 | several| differe|
|00005d10| 6e 74 20 77 61 79 73 2e | 20 4f 6e 65 20 77 61 79 |nt ways.| One way|
|00005d20| 20 74 68 61 74 20 69 73 | 20 66 61 69 72 6c 79 0d | that is| fairly.|
|00005d30| 09 20 73 74 72 61 69 67 | 68 74 66 6f 72 77 61 72 |. straig|htforwar|
|00005d40| 64 20 69 73 20 74 6f 20 | 72 75 6e 20 74 68 65 20 |d is to |run the |
|00005d50| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 69 6e 20 74 |applicat|ion in t|
|00005d60| 68 65 20 6d 69 6e 69 6d | 75 6d 20 73 69 7a 65 20 |he minim|um size |
|00005d70| 63 6f 6e 66 69 67 75 72 | 61 74 69 6f 6e 0d 09 20 |configur|ation.. |
|00005d80| 61 73 20 64 65 73 63 72 | 69 62 65 64 20 70 72 65 |as descr|ibed pre|
|00005d90| 76 69 6f 75 73 6c 79 2e | 20 43 61 6c 6c 20 50 75 |viously.| Call Pu|
|00005da0| 72 67 65 53 70 61 63 65 | 20 61 74 20 69 6e 69 74 |rgeSpace| at init|
|00005db0| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 61 6e 64 20 65 |ializati|on and e|
|00005dc0| 78 61 6d 69 6e 65 20 74 | 68 65 20 76 61 6c 75 65 |xamine t|he value|
|00005dd0| 0d 09 20 72 65 74 75 72 | 6e 65 64 2e 20 48 6f 77 |.. retur|ned. How|
|00005de0| 65 76 65 72 2c 20 79 6f | 75 20 73 68 6f 75 6c 64 |ever, yo|u should|
|00005df0| 20 6d 61 6b 65 20 73 75 | 72 65 20 74 68 61 74 20 | make su|re that |
|00005e00| 74 68 69 73 20 72 65 73 | 75 6c 74 20 69 73 20 6e |this res|ult is n|
|00005e10| 6f 74 20 62 65 69 6e 67 | 20 6d 6f 64 69 66 69 65 |ot being| modifie|
|00005e20| 64 0d 09 20 62 79 20 74 | 68 65 20 73 63 72 61 70 |d.. by t|he scrap|
|00005e30| 27 73 20 70 72 65 73 65 | 6e 63 65 2e 20 59 6f 75 |'s prese|nce. You|
|00005e40| 20 63 61 6e 20 64 6f 20 | 74 68 61 74 20 62 79 20 | can do |that by |
|00005e50| 63 61 6c 6c 69 6e 67 20 | 5a 65 72 6f 53 63 72 61 |calling |ZeroScra|
|00005e60| 70 20 62 65 66 6f 72 65 | 20 63 61 6c 6c 69 6e 67 |p before| calling|
|00005e70| 0d 09 20 50 75 72 67 65 | 53 70 61 63 65 2e 20 4d |.. Purge|Space. M|
|00005e80| 61 6b 65 20 73 75 72 65 | 20 74 6f 20 72 65 6d 6f |ake sure| to remo|
|00005e90| 76 65 20 74 68 61 74 20 | 63 61 6c 6c 20 62 65 66 |ve that |call bef|
|00005ea0| 6f 72 65 20 73 68 69 70 | 70 69 6e 67 2c 20 74 68 |ore ship|ping, th|
|00005eb0| 6f 75 67 68 2e 7d 0d 09 | 20 0d 09 50 75 72 67 65 |ough.}..| ..Purge|
|00005ec0| 53 70 61 63 65 28 74 6f | 74 61 6c 2c 20 63 6f 6e |Space(to|tal, con|
|00005ed0| 74 69 67 29 3b 0d 09 49 | 46 20 74 6f 74 61 6c 20 |tig);..I|F total |
|00005ee0| 3c 20 6b 4d 69 6e 53 70 | 61 63 65 20 54 48 45 4e |< kMinSp|ace THEN|
|00005ef0| 0d 09 09 46 61 69 6c 75 | 72 65 28 30 2c 20 65 4e |...Failu|re(0, eN|
|00005f00| 6f 4d 65 6d 6f 72 79 29 | 3b 0d 0d 09 7b 54 68 65 |oMemory)|;...{The|
|00005f10| 20 65 78 74 72 61 20 62 | 65 6e 65 66 69 74 20 74 | extra b|enefit t|
|00005f20| 6f 20 77 61 69 74 6e 67 | 20 75 6e 74 69 6c 20 61 |o waitng| until a|
|00005f30| 66 74 65 72 20 74 68 65 | 20 54 6f 6f 6c 62 6f 78 |fter the| Toolbox|
|00005f40| 20 4d 61 6e 61 67 65 72 | 73 20 68 61 76 65 20 62 | Manager|s have b|
|00005f50| 65 65 6e 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 0d |een init|ialized.|
|00005f60| 09 20 62 65 66 6f 72 65 | 20 63 68 65 63 6b 69 6e |. before| checkin|
|00005f70| 67 20 6d 65 6d 6f 72 79 | 20 69 73 20 74 68 61 74 |g memory| is that|
|00005f80| 20 77 65 20 63 61 6e 20 | 6e 6f 77 20 67 69 76 65 | we can |now give|
|00005f90| 20 74 68 65 20 75 73 65 | 72 20 61 6e 20 61 6c 65 | the use|r an ale|
|00005fa0| 72 74 20 74 6f 20 74 65 | 6c 6c 20 68 69 6d 20 77 |rt to te|ll him w|
|00005fb0| 68 61 74 0d 09 20 68 61 | 70 70 65 6e 65 64 2e 20 |hat.. ha|ppened. |
|00005fc0| 41 6c 74 68 6f 75 67 68 | 20 69 74 20 69 73 20 70 |Although| it is p|
|00005fd0| 6f 73 73 69 62 6c 65 20 | 74 68 61 74 20 74 68 65 |ossible |that the|
|00005fe0| 20 6d 65 6d 6f 72 79 20 | 73 69 74 75 61 74 69 6f | memory |situatio|
|00005ff0| 6e 20 63 6f 75 6c 64 20 | 62 65 20 77 6f 72 73 65 |n could |be worse|
|00006000| 6e 65 64 20 62 79 0d 09 | 20 64 69 73 70 6c 61 79 |ned by..| display|
|00006010| 69 6e 67 20 61 6e 20 61 | 6c 65 72 74 2c 20 4d 75 |ing an a|lert, Mu|
|00006020| 6c 74 69 46 69 6e 64 65 | 72 20 77 6f 75 6c 64 20 |ltiFinde|r would |
|00006030| 67 72 61 63 65 66 75 6c | 6c 79 20 65 78 69 74 20 |graceful|ly exit |
|00006040| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00006050| 77 69 74 68 0d 09 20 61 | 6e 20 69 6e 66 6f 72 6d |with.. a|n inform|
|00006060| 61 74 69 76 65 20 61 6c | 65 72 74 20 69 66 20 6d |ative al|ert if m|
|00006070| 65 6d 6f 72 79 20 62 65 | 63 61 6d 65 20 63 72 69 |emory be|came cri|
|00006080| 74 69 63 61 6c 2e 20 48 | 65 72 65 20 77 65 20 61 |tical. H|ere we a|
|00006090| 72 65 20 61 63 74 69 6e | 67 20 6d 6f 72 65 0d 09 |re actin|g more..|
|000060a0| 20 69 6e 20 61 20 70 72 | 65 76 65 6e 74 61 74 69 | in a pr|eventati|
|000060b0| 76 65 20 6d 61 6e 6e 65 | 72 20 74 6f 20 61 76 6f |ve manne|r to avo|
|000060c0| 69 64 20 66 75 74 75 72 | 65 20 64 69 73 61 73 74 |id futur|e disast|
|000060d0| 65 72 20 66 72 6f 6d 20 | 6c 6f 77 2d 6d 65 6d 6f |er from |low-memo|
|000060e0| 72 79 20 70 72 6f 62 6c | 65 6d 73 2e 7d 0d 0d 09 |ry probl|ems.}...|
|000060f0| 6d 65 6e 75 42 61 72 20 | 3a 3d 20 47 65 74 4e 65 |menuBar |:= GetNe|
|00006100| 77 4d 42 61 72 28 72 4d | 65 6e 75 42 61 72 29 3b |wMBar(rM|enuBar);|
|00006110| 09 09 7b 72 65 61 64 20 | 6d 65 6e 75 73 20 69 6e |..{read |menus in|
|00006120| 74 6f 20 6d 65 6e 75 20 | 62 61 72 7d 0d 09 46 61 |to menu |bar}..Fa|
|00006130| 69 6c 4e 49 4c 4d 73 67 | 28 6d 65 6e 75 42 61 72 |ilNILMsg|(menuBar|
|00006140| 2c 20 65 4e 6f 4d 65 6d | 6f 72 79 29 3b 0d 09 53 |, eNoMem|ory);..S|
|00006150| 65 74 4d 65 6e 75 42 61 | 72 28 6d 65 6e 75 42 61 |etMenuBa|r(menuBa|
|00006160| 72 29 3b 09 09 09 09 09 | 7b 69 6e 73 74 61 6c 6c |r);.....|{install|
|00006170| 20 6d 65 6e 75 73 7d 0d | 09 44 69 73 70 6f 73 48 | menus}.|.DisposH|
|00006180| 61 6e 64 6c 65 28 6d 65 | 6e 75 42 61 72 29 3b 0d |andle(me|nuBar);.|
|00006190| 09 41 64 64 52 65 73 4d | 65 6e 75 28 47 65 74 4d |.AddResM|enu(GetM|
|000061a0| 48 61 6e 64 6c 65 28 6d | 41 70 70 6c 65 29 2c 20 |Handle(m|Apple), |
|000061b0| 27 44 52 56 52 27 29 3b | 09 7b 61 64 64 20 44 41 |'DRVR');|.{add DA|
|000061c0| 20 6e 61 6d 65 73 20 74 | 6f 20 41 70 70 6c 65 20 | names t|o Apple |
|000061d0| 6d 65 6e 75 7d 0d 09 44 | 72 61 77 4d 65 6e 75 42 |menu}..D|rawMenuB|
|000061e0| 61 72 3b 0d 09 67 53 68 | 61 70 65 20 3a 3d 20 6b |ar;..gSh|ape := k|
|000061f0| 4f 76 61 6c 3b 0d 09 67 | 55 73 65 42 61 63 6b 20 |Oval;..g|UseBack |
|00006200| 3a 3d 20 54 52 55 45 3b | 0d 09 67 55 73 65 45 64 |:= TRUE;|..gUseEd|
|00006210| 69 74 20 3a 3d 20 54 52 | 55 45 3b 0d 09 67 4f 75 |it := TR|UE;..gOu|
|00006220| 67 68 48 61 6e 64 6c 65 | 20 3a 3d 20 4e 49 4c 3b |ghHandle| := NIL;|
|00006230| 0d 09 0d 09 7b 47 65 74 | 20 74 68 65 20 27 4d 6f |....{Get| the 'Mo|
|00006240| 6f 66 27 20 69 63 6f 6e | 2e 20 49 66 20 74 68 65 |of' icon|. If the|
|00006250| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 73 75 70 | environ|ment sup|
|00006260| 70 6f 72 74 73 20 43 6f | 6c 6f 72 20 51 44 2c 0d |ports Co|lor QD,.|
|00006270| 09 20 77 65 27 6c 6c 20 | 67 65 74 20 74 68 65 20 |. we'll |get the |
|00006280| 63 6f 6c 6f 72 20 69 63 | 6f 6e 2e 20 49 66 20 43 |color ic|on. If C|
|00006290| 6f 6c 6f 72 20 51 44 20 | 69 73 20 6e 6f 74 20 73 |olor QD |is not s|
|000062a0| 75 70 70 6f 72 74 65 64 | 2c 0d 09 20 77 65 27 6c |upported|,.. we'l|
|000062b0| 6c 20 73 74 69 6c 6c 20 | 67 65 74 20 74 68 65 20 |l still |get the |
|000062c0| 63 6f 6c 6f 72 20 69 63 | 6f 6e 2c 20 62 75 74 20 |color ic|on, but |
|000062d0| 75 73 65 20 69 74 20 64 | 69 66 66 65 72 65 6e 74 |use it d|ifferent|
|000062e0| 6c 79 2e 7d 0d 09 20 0d | 09 49 46 20 67 4d 61 63 |ly.}.. .|.IF gMac|
|000062f0| 2e 68 61 73 43 6f 6c 6f | 72 51 44 20 54 48 45 4e |.hasColo|rQD THEN|
|00006300| 20 42 45 47 49 4e 0d 09 | 09 67 63 69 63 6e 20 3a | BEGIN..|.gcicn :|
|00006310| 3d 20 47 65 74 43 49 63 | 6f 6e 28 6b 43 4d 6f 6f |= GetCIc|on(kCMoo|
|00006320| 66 29 3b 0d 09 09 46 61 | 69 6c 4e 49 4c 4d 73 67 |f);...Fa|ilNILMsg|
|00006330| 28 67 63 69 63 6e 2c 20 | 65 4e 6f 4d 65 6d 6f 72 |(gcicn, |eNoMemor|
|00006340| 79 29 3b 0d 09 45 4e 44 | 20 45 4c 53 45 20 42 45 |y);..END| ELSE BE|
|00006350| 47 49 4e 0d 09 09 67 63 | 69 63 6e 20 3a 3d 20 43 |GIN...gc|icn := C|
|00006360| 49 63 6f 6e 48 61 6e 64 | 6c 65 28 47 65 74 52 65 |IconHand|le(GetRe|
|00006370| 73 6f 75 72 63 65 28 27 | 63 69 63 6e 27 2c 20 6b |source('|cicn', k|
|00006380| 43 4d 6f 6f 66 29 29 3b | 0d 09 09 46 61 69 6c 4e |CMoof));|...FailN|
|00006390| 49 4c 4d 73 67 28 67 63 | 69 63 6e 2c 20 65 4e 6f |ILMsg(gc|icn, eNo|
|000063a0| 4d 65 6d 6f 72 79 29 3b | 0d 09 45 4e 44 3b 0d 09 |Memory);|..END;..|
|000063b0| 0d 09 7b 49 66 20 43 6f | 6c 6f 72 20 51 44 20 69 |..{If Co|lor QD i|
|000063c0| 73 20 73 75 70 70 6f 72 | 74 65 64 2c 20 77 65 27 |s suppor|ted, we'|
|000063d0| 6c 6c 20 67 65 74 20 61 | 6e 20 38 2d 62 69 74 20 |ll get a|n 8-bit |
|000063e0| 50 49 43 54 20 6f 66 0d | 09 20 47 69 67 61 6e 74 |PICT of.|. Gigant|
|000063f0| 6f 72 2e 20 49 66 20 69 | 74 20 69 73 6e 27 74 20 |or. If i|t isn't |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.